A combobox can be either a drop down list (editable=FALSE), or a drop-down list and edit area (a combobox).
Non exported helper function to coerce items into a data frame. First column contains the values, second stock icons, third tooltips
Ensure that value is a data frame. One can pass a vector or a one-column data frame to inidicate the possible values for selection, a second column is used for an icons (if possible), a third for a tooltip (if possible).
Change handler for a non-editabe combobox is called when a new value is selected. For editable comboboxes, the handler is also called when the text entry box is activated.
The svalue
method for a combobox object refers to its main
property, the selected value. When index=FALSE
(or
NULL
) the value is returned. If index=TRUE
the index
of the object within the set of items is used.
gcombobox(
items,
selected = 1,
editable = FALSE,
coerce.with = NULL,
handler = NULL,
action = NULL,
container = NULL,
...,
toolkit = guiToolkit()
).gcombobox(
toolkit,
items,
selected = 1,
editable = FALSE,
coerce.with = NULL,
handler = NULL,
action = NULL,
container = NULL,
...
)
gdroplist(...)
.make_gcombobox_items(value)
# S3 method for GComboBox
[ (x, i , j, ...) <- value
# S3 method for GComboBox
addHandlerChanged(obj, handler, action = NULL, ...)
# S3 method for GComboBox
svalue(obj, index = NULL, drop = NULL, ...)
Items to select from. A vector or a data frame. If a data frame, then first column is values. Second is optional, but can specify a stock icon name, third is optional and can be used to specify a tooltip. These may not be supported in all toolkits.
integer. Which item (by index) is selected. Use -1 for no selection
logical. Is user allowed to edit value
A function of function name to be called before
selected value is returned by svalue
Called when combobox value is changed.
passed to handler
parent container
passed to parent container's add
method
toolkit
new items for selection
combobox object
item index
ignored
object receiving event and emitting a signal to the handler
NULL or logical. If TRUE
and widget supports it an index, instead of a value will be returned.
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 GComboBox
for which the following methods are overriden:
svalue
Return selected value by name or (if index=TRUE
by index). The latter only if editable=FALSE
.
svalue<-
Set the selected value by value or if index=TRUE
by index.
[
return items to select from
[<-
Set items to select from.