Previous: Entry widgets
Up: Widgets
Next: Text widgets
Previous Page: Entry widgets
Next Page: Text widgets
Listbox widgets are similar in appearance to entry widgets, but allow several lines of text to be displayed, or selected.
#Set up a listbox to show rainbow colours listbox .listbox1 pack .listbox1#The following is an example of a widget specific command -this is #the insert operation for listboxes, which inserts a list of #items starting at line 0 .listbox1 insert 0 red orange yellow green blue indigo violet
An example of how mouse clicks can be used to select items from a listbox is given in the section on Widget Binding.