radioButtonGroup: Create an R object to manage a group of associated radio...

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function creates an R-level management structure for handling wxWidgets radio buttons that share state, i.e. that are mutually exclusive. There are facilities in wxWidgets to do this, but they put a constraint on the layout and ordering of the buttons and so we need our own. The idea is relatively simple. One creates a group and then adds radio buttons to it. These are added via the add function returned as part of the group object. We typically add these by name and so can recover them later. When a radio button in this group is selected, the others are deselected. Additionally, if the group was created with a callback function (the callback argument), then that callback is invoked when a button is selected. It is passed the radio button that was selected and its name and any additional arguments passed in the call to radioButtonGroup via the \Sdots parameter.

Usage

1
radioButtonGroup(callback = NULL, ..., elements = list(), currentValue = NA)

Arguments

callback

a function that accepts at least 2 arguments, the radio button that was just selected and its “name” as given via a call to add. Any values passed to the radioButtonGroup function call via \Sdots are also passed on to the callback.

...

additional arguments that are passed on to callback when a radio button is set by the user or programmatically.

elements

a list of the radio button objects/widgets. This is an argument so that one can create the radio buttons before creating the radio group. Typically, one creates the group and explicitly adds the radio buttons via a call to add.

currentValue

which of the radio buttons is set. This is a character string or integer identifying the element of the elements list.

Value

A list of class RadioButtonGroup whose elements are functions that allow one to modify and query the state of the radio group.

add
set
remove
getSelected
getValue

Author(s)

Duncan Temple Lang

References

wxWidgets documentation. http://www.wxwidgets.org/manuals/2.6

See Also

http://www.wxwidgets.org/manuals/2.6/wx_wxradiobox.html#wxradioboxwxRadioButton, http://www.wxwidgets.org/manuals/2.6/wx_wxradiobox.html#wxradiobuttonwxRadioBox.

Examples

1
 # see examples/embeddedDevice.R

omegahat/RwxWidgets documentation built on May 24, 2019, 1:56 p.m.