Copyright © 2008, 2009 Arndt Roger Schneider
The Gistbox, an edit able listbox, is a replacement for a combobox.
Example 5.1. Instantiation
# Create a listbox with a variable. # Note '-creator' is omitted. gistbox .gistbox -variable ::mydata
The Gistbox is responsible to create the internal listbox, regardless of its type. There are two ways how the internal listbox can be configured: Through the Option Database or via command-line after it was created.
Example 5.3. Modifying the internal Rtl_mlistbox after Instantiation
[.gistbox listbox] configure \ -sortable 1 \ -sortcommand sortnotifier \ -columns 2 \ -columnwidths {80 120} \ -headings {Type Property} \ -headingsanchor {w w}
Example 5.4. Predefine the internal Rtl_mlistbox
# Option Database entries... #... via path and class. option add *gistbox*Rtl_mlistbox.sortable 1 option add *gistbox*Rtl_mlistbox.sortcommand \ sortnotifier option add *gistbox*Rtl_mlistbox.columns 2 option add *gistbox*Rtl_mlistbox.columnwidths \ {80 120} option add *gistbox*Rtl_mlistbox.headings \ {Type Property} option add *gistbox*Rtl_mlistbox.headingsanchor \ {w w} # Or via full path (not recommended) option add *gistbox.gridwin.listbox.headings \ {Type Property} gistbox .gistbox -listtype rtl_mlistbox
The best approach is a combination between the Option Database –for speedy instantiation, and 'configure'. In this scenario each functional aspect, such as »sortable« and »sortcommand« is best 'configured'.
A Rtl_gridwin is used inside the Gistbox for scrollbar management. Another »listType« , other than listbox and Rtl_mlistbox, must not have integrated scrollbars.
It’s possible to query the Gistbox for its listbox and manipulate the data through this interface. The Gistbox does however provide another, higher level interface for data manipulation.
Gistbox Command Interface
Clear edit is used to clean the edit area
Erases the listbox content.
Is used to report changes inside the listbox to another application element.
Verifies, that there are items selected. This method is internally used.
Reports the amount of elements inside the listbox.
Deliver the current selection.
Don't know
Does replace the contents inside the listbox with the specified arguments.
Query all the contents inside the listbox