LablTk: listboxes

How to create a simple listbox?
Parameter selectmode specifies the selection mode.
Here are the possible values:
`Single  Only one element may be selected at a time.
`Multiple  Several elements may be selected.
Clicking on a non-selected element makes it selected.
Clicking on a selected element makes it non selected.
`Browse  Only one element may be selected at a time.
Moving the mouse while keeping pressed the left button of the mouse
causes the selection to be moved at the same time.
`Extended  The user may select several elements.
Clicking on a selected element unselects all other elements.
Moving the mouse selects all encountered elements.
Clicking on a non selected element while pressing Shift
selects all elements between the last selected element and the current element.
 

You have to use function Listbox.insert to insert a list of elements into a Listbox widget.
Its parameter index specifies at which position the insertion will start:
`Num n  Position in the list: an integer.
`End  End of list
`Active  Position of active element
`Anchor 
`Atxy of (x,y)  Index corresponding to the position (x,y) in pixels


How to select an item in a listbox?
Method Listbox.curselection the list of selected elements,
and an empty list if no element is currently selected.

Method Listbox.get the element whose index is given as a parameter
(with type `Num of int).


          

After selecting a composer
and clicking on "Show selected composer":










                  



François Thomasset -- INRIA, Rocquencourt -- November 2007
Email: Francois dot Thomasset at inria dot fr