activateWindow {iSPlot} | R Documentation

## Activate a Window so it has Focus

### Description

activateWindow sets the focus on a window based on the parameter, winNum. Every view that is opened has a window number (winNum). The first view opened has winNum=1, the second view opened has winNum=2, and so on. The control window has winNum=0. So the function, activateWindow, can set the focus on either the control window or one of the views. activateWindow is called by either using the Window menu on the control window or by using accelerators (a key press event).

### Usage

    activateWindow(winNum)

### Arguments

`winNum` | the window number, one of the slots in a view object

### Author(s)

Elizabeth Whalen

### See Also

`addWindowMenu`, `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)

        viewList<-get("viewList",viewEnv)
        winNums<-unlist(lapply(viewList, function(x) {winNum(x)}))
        # activate the first window number
        activateWindow(winNums[1])
      }

[Package iSPlot version 1.0.7 Index]