setCallFunc {iSPlot} | R Documentation

## Set a callback function to an event

### Description

setCallFunc sets a callback function to an event. This allows the user to change what will happen in response to an event. getEvents returns all possible events that the user can set a callback function to. getDescForEvents returns what callback functions are available for a certain event. So the order of calling these functions is: 1. First call getEvents to find out which events are available 2. Then call getDescForEvents to find out what callback functions are available for a particular event 3. Finally call setCallFunc to set a callback function to an event.

### Usage

    setCallFunc(event, shortName = "")
    getDescForEvent(event)
    getEvents()

### Arguments

`event` | the character string that refers to the event (all possible events can be determined using the function getEvents)
`shortName` | the description of the callback function; the callback function will be called in response to the event; if this parameter is left as an empty string, then no function will be called in response to the event (this value can be found by calling the function getDescForEvent)

### Value

getEvents will return all events that can be set to a callback function. These are stored in the environment variable, possEvents, in mvcEnv.
getDescForEvent will return the descriptions of all possible callback functions for a certain event. It is this character string (the description) that is used as the shortName parameter in the setCallFunc function.

### Author(s)

Elizabeth Whalen

### Examples

      if (interactive())
      {
        loadData("USArrests")
        setActiveMVC("USArrests")
        createSPlot(varx="Murder", vary="Assault")
        getEvents()
        getDescForEvent("leftButtonClick")
        setCallFunc("leftButtonClick", "highlight a point")
      }

[Package iSPlot version 1.12.0 Index]