The Listbox Widget
Create a listbox with the
You can then insert items into the listbox
The standard configuration options that apply to
Other options are:
Determines how many items can be selected at once, as well as key/mouse bindings.
modecan be any of:
Turns on gridding for the listbox. If the widget is resized, only complete lines and characters are displayed. Default is 0 (off).
In a Listbox widget, several indexes are defined to identify positions in the listbox, for use by the methods used for retrieving or manipulating listbox entries. These indexes are:
An integer representing a position in the list, with 0 as the first item.
The item with the keyboard focus.
The anchored position.
The last element in the listbox.
The listbox item containing the specified x,y coordinate.
In addition to
cget, the following methods
are supported by Listbox:
Adds items to a listbox at the specified index. For example, to insert items at the end of a list:
$listbox->insert('end', "Puerto Rico", "Virgin Islands", ...