Copyright © 2008, 2009 Arndt Roger Schneider
The RTL based option creator is used
to instantiate the template gistbox with a
Tk Window. The used creator window must have a
-class
property.
Acceptable Tk Windows are: toplevel for floating windows, and frame for embedded windows.
See the options manual entry for details on the standard options.
»ihighlightTchickness« and »ihighlightBackground« create a frame around the internal listbox and entry.
»ihighlightThickness« is dedicated to AQUA®. The »solid« relief in Tcl/Tk is currently black and should be »gray57« under AQUA®.
set »ihighlightThickness« to »1« and »ihighlightBackground« to »gray57« under AQUA®; otherwise don’t use the ihighlight properties.
Not used.
Set »ihighlightBackground« to »gray57« under AQUA®. Otherwise don’t use this property.
See also »ihighlightThickness«.
Specifies the name of a variable. The value of the variable is a list to be displayed inside the widget; if the variable value changes then the widget will automatically update itself to reflect the new value. Attempts to assign a variable with an invalid list value to -variable will cause an error. Attempts to unset a variable in use as a -variable will fail but will not generate an error.
»plusCommand« is usually mapped to the Gistbox »add« command.
»minusCommand« is usually mapped to the Gistbox »delete« command.
A command. The »notify« command is called after the contents changed.
Example A.3. Notify after modifications
gistbox .gistbox \ -listtype listbox \ -notify [list refresh .gistbox] ... proc refresh {{notifier {}}} { ... }
»iborderWidth« and »irelief« define the internal border around the entry and listbox windows.
Specifies a non-negative value indicating the width of the pseudo 3-D border to draw around the outside of the widget (if such a border is being drawn; the relief option typically determines this). The value may also be used when drawing pseudo 3-D effects in the interior of the widget. The value may have any of the forms acceptable to Tk_GetPixels.
The Gistbox is a composite window. »irelief« and »iborderWidth« control the internal border around the listbox and entry.
Specifies the pseudo 3-D effect desired for the widget. Acceptable values are raised, sunken, flat, ridge, solid and groove. The value indicates how the interior of the widget should appear relative to its exterior; for example, raised means the interior of the widget should appear to protrude from the screen, relative to the exterior of the widget.
Specifies one of several styles for manipulating the selection. The value of the option may be arbitrary, but the default bindings expect it to be either single, browse, multiple, or extended; the default value is browse.
The internal listbox. The kind of the internal listbox can be defined prior creation. listType is a static property.
The used list must conform to the Tk listbox interface.
Rtl_mlistbox, hugelist or listbox can be used.
Either '0' or '1'. If »single« is specified, the entire entry text is treated as a single item. Otherwise the entry text is broken into atoms and each atom is inserted as an item to the listbox.
Example A.6. Single Entry Property
gistbox .gistbox -single 1 # Entry contents: »This is a single entry«. # Becomes a single item inside the listbox # after it was added.
Figure A.1, “Gistbox” displays a gistbox window containing a rtl_mlistbox with hugelist listboxes. These hugelists feature gradients for selected items.
gistbox is an edit able listbox. combobox is similar to gistbox. gistbox set the emphasis on the listbox content and not –as the combobox does– on the interaction.
gistbox itself is a typical container window. It can be used with any listbox-like window, such as rtl_mlistbox, hugelist, listbox, perhaps even tablelist...
The »-listtype« property predefines the listbox type.
gistboxes cannot be used inside of gistboxes!
An rtl_gridwin manages the scrollbars.
A Window created through the gistbox command exposes various functions. Using these functions has the following general form:
pathName option ?arg arg ...?
PathName is the same as the window path name. Option and the args determine the exact behavior of the command. The following commands are possible for this window:
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the gistbox command.
Query or modify the configuration options of the window. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given window option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the gistbox command.
Notifies the gistbox whenever the focus gets lost. The highlight frame is hidden in response. See also »focusIn«
Shows and hide the highlight (keyboard focus). wd can be negative – needed to hide highlight frames during resize operations.
The length of the listbox contents.
Remove each selected item in the listbox from the list.
Test whether or not there is a current selection. The query depends on the current state of the gistbox.
Rewritten : 10/22/2007, Roger
For alternate listbox types an access method is required: »rtl_mlistbox«, for example, requires further configuration.
Query the gistbox, for all the elements inside the listbox.
Add each item in the entry widget to the listbox.
Send a notification to the subscribing window –this is a command call.
Internal used. Manipulates the surrounding white space, which belongs to the »gistbox«.
Replace all items inside the listbox with those defined inside of list »items«. Revision : 10/23/2007, Roger
Return the content of the entry ... in order to process an external add.
Deliver the contents of the current selected listbox items. This is different to »curselection« from listbox. Here the content is returned.
Internal Focus manager showing synthetic highlight frames.
The »focusIn« function has two implementations: when »stripes« is being used for the gistbox, the highlight frame is a tkpath »prect«. Otherwise plain frames implement highlighting.
Two gstripes functions are used : focusframes or focuspathes.
focuspathes requires TkPath else focusframes is the fall back solution.
focusframes has two implementations inside of gstripes: One using vanilla Tk, and the other using »prect« from TkPath. Technically only the vanilla Tk version can be used by gistbox– because focuspathes takes precedence over focusframes.
Forces a redraw of the entire gistbox.