Description Usage Arguments Value Author(s) References See Also Examples
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.
1 | radioButtonGroup(callback = NULL, ..., elements = list(), currentValue = NA)
|
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 |
... |
additional arguments that are passed on to
|
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 |
currentValue |
which of the radio buttons is set. This is a
character string or integer identifying the element of the
|
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 |
Duncan Temple Lang
wxWidgets documentation. http://www.wxwidgets.org/manuals/2.6
http://www.wxwidgets.org/manuals/2.6/wx_wxradiobox.html#wxradioboxwxRadioButton, http://www.wxwidgets.org/manuals/2.6/wx_wxradiobox.html#wxradiobuttonwxRadioBox.
1 | # see examples/embeddedDevice.R
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.