constructor for a combobox
A combobox can be either a drop down list (editable=FALSE), or a drop-down list and edit area (a combobox).
generic for toolkit dispatch
Alias for gcombobox. Deprecated
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 replacement method for class 'GComboBox' x[i , j, ...] <- value ## S3 method for class 'GComboBox' addHandlerChanged(obj, handler, action = NULL, ...) ## S3 method for class 'GComboBox' svalue(obj, index = NULL, drop = NULL, ...)
items |
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. |
selected |
integer. Which item (by index) is selected. Use -1 for no selection |
editable |
logical. Is user allowed to edit value |
coerce.with |
A function of function name to be called before
selected value is returned by |
handler |
Called when combobox value is changed. |
action |
passed to handler |
container |
parent container |
... |
passed to parent container's |
toolkit |
toolkit |
value |
new items for selection |
x |
combobox object |
i |
item index |
j |
ignored |
obj |
object receiving event and emitting a signal to the handler |
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 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.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.