closeWin               package:iSPlot               R Documentation

_A_d_d _a _c_a_l_l_b_a_c_k _f_o_r _t_h_e _d_e_l_e_t_e _e_v_e_n_t _f_o_r _a _g_t_k _w_i_n_d_o_w

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

     closeWin adds a callback to a gtk window for the delete event. 
     The  delete event will call setDeleteEvents, which will remove the
     window,  view and device information from environment variables
     and from R's  device list.

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

     closeWin(viewItem)

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

viewItem: the view object to remove 

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

     Elizabeth Whalen

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

     'setDeleteEvents',   'createView'

_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 the delete event to occur and
         # the delete event callback is defined in closeWin

         # 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()  
       }

