removeDevices             package:iSPlot             R Documentation

_R_e_m_o_v_e _a _g_t_k _d_e_v_i_c_e _f_r_o_m _R'_s _d_e_v_i_c_e _l_i_s_t

_D_e_s_c_r_i_p_t_i_o_n:

     removeDevices removes gtk devices from R's device list because
     closing  a gtk window will not remove the device from R's device
     list  automatically.  Therefore, removeDevices must be called
     every time there  is a destroy event for a gtk window containing a
     gtk device.

_U_s_a_g_e:

     removeDevices(curDev)

_A_r_g_u_m_e_n_t_s:

  curDev: the device number(s) to be removed from R's device list 

_A_u_t_h_o_r(_s):

     Elizabeth Whalen

_S_e_e _A_l_s_o:

     'setDeleteEvents'

_E_x_a_m_p_l_e_s:

       if (interactive())
       {
         createControlWindow()
         # should load data through Open Data or Open File under the File menu
         data(USArrests)
         loadDFData(USArrests,"USArrests")
         # plotting the data should occur through Plot Data under 
         # the Display menu
         createView(type = "plotView", dataName = "USArrests", 
                    plotType = "sPlotView", dfRows = 1:nrow(USArrests), 
                    dfColumns = 1:2) 
         # now check R's device list
         dev.list()

         # now close the gtk window that has the scatterplot in it
         # then check R's device list again - that device should be removed 
         dev.list()

         # in comparison
         w<-gtkWindow(show=FALSE)
         dr<-gtkDrawingArea()
         asGtkDevice(dr)
         w$Add(dr)
         w$Show()
         # now check R's device list
         dev.list()
         # now close the gtk window
         w$Destroy()
         # and again check R's device list 
         # the gtk device will still be in R's list (use dev.off to remove it)
         dev.list()
       }

