closeWin {iSPlot} | R Documentation

## Add a callback for the delete event for a gtk window

### Description

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.

### Usage

    closeWin(viewItem)

### Arguments

`viewItem` | the view object to remove

### Author(s)

Elizabeth Whalen

### See Also

`setDeleteEvents`, `createView`

### Examples

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

[Package iSPlot version 1.0.7 Index]