Version 20 of listbox

Updated 2003-07-02 21:57:21

Create and display a list of items, one per line.

http://www.purl.org/tcl/home/man/tcl8.4/TkCmd/listbox.htm

Often someone asks how to get a listbox to take more than one selection and people recommend they read the above reference page's information on -exportselection 0 . CJU: Normally, if you have more than one listbox on the screen, selecting one listbox automatically unselects any previous selections in the all of the others. -exportselection 0 is a way of getting around that at the cost of not being able to export the list element(s) to the X selection. I understand the reasoning for this behavior, but I think the default for -exportselection should be 0 instead of 1 for the listbox simply due to the confusion it can cause for newcomers of Tk and also the relative rarity of the need to copy from a listbox as opposed to a text or entry widget, for example. Often someone asks how to get a listbox to take more than one selection and MGS - Note: selection is not the same as the clipboard. See: selection CJU - Corrected it. MGS: Note: selection is not the same as the clipboard. See: selection

Tk's venerable FAQ covers several aspects of listbox management which are, in fact, frequently-asked. Among these are synchronization between parallel listboxes, multi-selection, ... [L1 ]. Also, note that people who start with listboxes often want to move to comboboxes, wcb, multicolumn listboxes, hugecombo, ...


Category Widget | Category Command | Tk syntax help | Arts and Crafts of Tcl-Tk Programming