setDeleteEvents            package:iSPlot            R Documentation

_S_e_t _u_p _t_h_e _p_r_o_p_e_r _e_v_e_n_t_s _w_h_e_n _a _g_t_k _w_i_n_d_o_w _i_s _d_e_l_e_t_e_d

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

     setDeleteEvents removes the gtk window, gtk device and view 
     information from environment variables in viewEnv and also removes
      the device from R's device list.  setDeleteEvents calls
     removeDevices  and removeEnvView before destroying the window. 
     setDeleteEvents also removes the window menu item on the control
     window that refers to this view and it removes the accelerator
     that would activate this view.

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

     setDeleteEvents(viewItem)

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

viewItem: the view object to delete 

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

     Elizabeth Whalen

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

     'removeDevices', 'removeEnvView', 'closeWin', 'clearAllWindows',
     'removeAccelerators', 'addWindowMenu'

_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 viewList in viewEnv, as well as R's device list
         get("viewList",viewEnv)
         dev.list()

         # now close the gtk window that has the scatterplot in it
         # closing the window will cause setDeleteEvents to be called

         # then check again viewList in viewEnv, as well as 
         # R's device list - all should have removed the window and device info 
         get("viewList",viewEnv)      
         dev.list()
       }

