Create a listbox with the Listbox method. You can then insert items into the listbox using the insert method.
$parentwidget->Listbox (options)
The standard configuration options that apply to Listbox are: -background, -bg, -borderwidth, -bd, -cursor, -exportselection, -font, -foreground, -fg, -height, -highlightbackground, -highlightcolor, -highlightthickness, -relief, -select-background, -selectborderwidth, -selectforeground, -takefocus, -width, -xscroll-command, and -yscrollcommand.
Other options are:
In a Listbox widget, several indexes are defined to identify positions in the listbox. These are used by the methods that retrieve and manipulate listbox entries.
In addition to configure and cget, the following methods are supported by Listbox:
$listbox->insert('end', "Puerto Rico", "Virgin Islands", "Guam");
$listbox->delete(0,'end');
@items = $listbox->get(0,'end');
$listbox->selection('clear', 0, 'end');
$listbox->selection('includes', 'end');
$listbox->selection('set', 0, 'end');
Copyright © 2002 O'Reilly & Associates. All rights reserved.