widgetTools (version 1.50.0)

makeViewer: Put a Scrollable List Box into a tkWidget.

Description

This function associates a tk listbox with a scroll bar and then puts them into a given tk widget.

Usage

makeViewer(target, vWidth = "", vHeight = "", hScroll = FALSE, vScroll = TRUE, what = "list", side = "left", text = "")

Arguments

target
tk widget that can accommodate a list box.
vWidth, vHeight
integers giving width and height of the listbox.
hScroll, vScroll
logicals indicating whether a horizontal or vertical scroll bar should be associated with the list box.
what
A character string indicating the type of the viewer to be put on a widget. Valid types include "list" for list box, "canvas", and "text" for text box
side
A character string for the geometry management of the viewer on the widget. Valid values include "left", "right", "top", and "bottom"
text
A character string to be displayed

Value

This function does not return any value.

Details

Tk list boxes (or canvas, text box) and scroll bars are separate widgets. This function provides a common interface to put them together and functionally associated.

See Also

tklistbox (from the ‘tcltk’ package).

Examples

Run this code
## Not run: 
#     ## These cannot be run by examples() but should be OK when pasted
#     ## into an interactive R session with the widgetTools package loaded
#     
#     # Create a top level window and put a list box in it
#     base <- tktoplevel()
#     listBox <- makeViewer(base)
# 
#     # Destroy toplevel widget
#     # tkdestroy(base)
#  ## End(Not run)

Run the code above in your browser using DataLab