Practical Programming in Tcl & Tk, Third Edition By Brent B. Welch
Table of Contents
Chapter 32. The Listbox Widget
Table 32-9 lists the listbox widget attributes. The table uses the resource name for the attribute, which has capitals at internal word boundaries. In Tcl commands these options are specified with a dash and all lowercase.
Table 32-9. Listbox attribute resource names.
background
Background color (also bg).
borderWidth
Extra space around the edge of the text.
cursor
Cursor to display when mouse is over the widget.
exportSelection
If true, then the selected text is exported via the X selection mechanism.
font
Font for the text.
foreground
Foreground color (also fg).
height
Number of lines in the listbox.
highlightBackground
Focus highlight color when widget does not have focus.
highlightColor
Focus highlight color when widget has focus.
highlightThickness
Thickness of focus highlight rectangle.
relief
flat, sunken, raised, groove, solid, or ridge.
selectBackground
Background color of selection.
selectForeground
Foreground color of selection.
selectBorderWidth
Width of selection border. Nonzero for 3D effect.
selectMode
Mode: browse, single, extended, or multiple.
setGrid
Boolean. Set gridding attribute.
takeFocus
Controls focus changes from keyboard traversal.
width
Width, in average character sizes.
xScrollCommand
Connects listbox to a horizontal scrollbar.
yScrollCommand
Connects listbox to a vertical scrollbar.
Geometry Gridding
The setGrid attribute affects interactive resizing of the window containing the listbox. By default, a window can be resized to any size. If gridding is turned on, the size is restricted so that a whole number of lines and a whole number of average-width characters is displayed. Gridding affects the user feedback during an interactive resize. Without gridding the size is reported in pixel dimensions. When gridding is turned on, then the size is reported in grided units.