Description Usage Arguments Value Examples
View source: R/gcheckboxgroup.R
Change handler for a GCheckboxGroup
p is called when any of the
checkboxes changes state.
The svalue
methods refer to the selected values. By default
these are the item values, coerced to characterq. When
index=TRUE
is specified, then the index is returned as an
integer vector. For setting, one may also use a vector of logicals
(which is recycled) for the index.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | gcheckboxgroup(
items,
checked = FALSE,
horizontal = FALSE,
use.table = FALSE,
handler = NULL,
action = NULL,
container = NULL,
...,
toolkit = guiToolkit()
)
.gcheckboxgroup(
toolkit,
items,
checked = FALSE,
horizontal = FALSE,
use.table = FALSE,
handler = NULL,
action = NULL,
container = NULL,
...
)
## S3 method for class 'GCheckboxGroup'
addHandlerChanged(obj, handler, action = NULL, ...)
## S3 method for class 'GCheckboxGroup'
svalue(obj, index = NULL, drop = NULL, ...)
|
items |
checkbox labels |
checked |
logical. Are values checked |
horizontal |
logical. If true displayed horizontally, else vertically |
use.table |
logical. If supported, and |
handler |
A handler assigned to the default change
signal. Handlers are called when some event triggers a widget to
emit a signal. For each widget some default signal is assumed, and
handlers may be assigned to that through Handlers may also be added via |
action |
User supplied data passed to the handler when it is called |
container |
A parent container. When a widget is created it can be incorporated into the widget heirarchy by passing in a parent container at construction time. (For some toolkits this is not optional, e.g. gWidgets2tcltk or gWidgets2WWW2.) |
... |
These values are passed to the |
toolkit |
Each widget constructor is passed in the toolkit it
will use. This is typically done using the default, which will
lookup the toolkit through |
obj |
receiver object |
index |
NULL or logical. If |
drop |
NULL or logical. If widget supports it, drop will work as it does in a data frame or perhaps someother means. |
Returns an object of class GCheckboxGroup
for which
the following methods are overridden:
svalue
Return the selected values or an empty
character vector. If index=TRUE
, returns indices of
selected values.
svalue<-
Set the selected values one of three ways:
by label name, by a logical variable indicating which are selected
(if ambigous, logical wins), if index=TRUE
by the indices
to select.
[
returns labels
[<-
set the label values. Should be able to shorten
or lengthen list
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | if(interactive()) {
w <- gwindow("Selection widgets")
g <- gvbox(cont=w)
fl <- gformlayout(cont=g)
gcheckbox("checkbox", checked=TRUE, cont=fl, label="checkbox")
gradio(state.name[1:4], selected=2, horizontal=TRUE, cont=fl, label="gradio")
gcheckboxgroup(state.name[1:4], horizontal=FALSE, cont=fl, label="checkbox group")
bg <- ggroup(cont=g)
gbutton("ok", cont=bg, handler=function(h,...) print(sapply(fl$children, svalue)))
}
|
Loading required package: digest
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.