dropdownList {widgetTools} | R Documentation |
A widget to mimic a dropdown list
Description
The current tcltk library does not support dropdown lists unless an extension is included. The function dropdownList provide an alternative.
Usage
dropdownList(base, options, textvariable, width = 10, default, editable
= FALSE)
getListOption(targetWidget, options, height, vScroll = FALSE)
Arguments
base |
|
options |
|
textvariable |
|
width |
|
default |
|
targetWidget |
|
editable |
|
height |
|
vScroll |
|
Details
base
can be a top window or a frame.
The widget returns a frame that contains a dropdown list. The frame need to be placed using any of the layout methods of tcltk. The value of the selection will be accessed through the tclVar object passed to the function.
getListOptions is called by dropdown list to get the selected item
Value
dropdownList returns a tkwin object for the frame that contains a dropdown list
getListOptions returns a character string for the selected item
Author(s)
Jianhua Zhang
References
tcltk
See Also
Examples
## Not run:
## These cannot be run by examples() but should be OK when pasted
## into an interactive R session with the widgetTools package loaded
base <- tktoplevel()
selection <- tclVar()
dropdownList(base, c("Option 1", "Option 2", "Option 3"),
selection, 15, "Option 2")
tclvalue(selection)
# Destroy toplevel widget
# tkdestroy(base)
## End(Not run)