
6. The Listbox Widget 19
6. The Listbox Widget
Listbox Widget Options
-selectmode single|browse|multiple|extended
Listbox Indices: number (starts at 0), active, anchor,
end, @x,y
Listbox Widget Commands
$listbox->activate(index);
Sets the active element to index.
$listbox->bbox(index);
Returns a list (x, y, width, height) giving an approximate
bounding box of character given by index.
$listbox->curselection;
Returns list of indices of all elements currently selected.
$listbox->delete(index1 ?, index2 ?);
Deletes range of elements from index1 to index2
(defaults to index1).
$listbox->get(index1 ?, index2 ?);
Returns as a list contents of elements from index1 to
index2.
$listbox->index(index);
Returns position index in number notation.
-background -relief
-borderwidth -selectbackground
-cursor -selectborderwidth
-exportselection -selectforeground
-font -setgrid
-foreground -takefocus
-height -width
-highlightbackground -xscrollcommand
-highlightcolor -yscrollcommand
-highlightthickness