tixCheckList pathName ?options?
The TixCheckList class is derived from the TixTree class and inherits all the commands, options and subwidgets of its super-class.
TixCheckList supports all the standard options of a frame widget. See the options(n) manual entry for details on the standard options.
[-browsecmd browseCmd] Specifies a command to call whenever the user browses on an entry (usually by single-clicking on the entry). The command is called with one argument, the pathname of the entry.[-command command] Specifies a command to call whenever the user activates an entry (usually by double-clicking on the entry). The command is called with one argument, the pathname of the entry.[-radio radio] A Boolean value. If set to true, the user can select at most one item at a time; if set to false, the user can select as many items as possible.
The hierarchical listbox that displays the CheckList.
The horizontal scrollbar subwidget.
The vertical scrollbar subwidget.
The tixCheckList command creates a new window (given by the pathName argument) and makes it into a CheckList widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the CheckList widget such as its cursor and relief.
The CheckList widget displays a list of items to be selected by the user. CheckList acts similarly to the Tk checkbutton or radiobutton widgets, except it is capable of handling many more items than checkbuttons or radiobuttons.
The items are contained in the hlist subwidget. Each item may be in one of the following status: on (indicated by a check bitmap), off (indicated by a cross bitmap) default (indicated by a gray box bitmap) or none, in which case the item will not be accompanied by a bitmap. The items whose status is on, off or default are called the selectable items and can be checked or crossed by the user. All selectable entries must be of the type imagetext.
The items whose status is none cannot be checked or crossed by the user; usually they are included in the hlist subwidget only for explanation purposes or as separators.
Initially, all the items have a none status. To make an item selectable, you can call the setstatus command to change its status (see below).
Notice that CheckList is a subclass of the TixTree widget and thus is is capable of displaying a hierachy of selectable entries. When necessary, you can call the setmode method (see TixTree(n)) to define the hierachical structure of the selectable entries.
The tixCheckList command creates a new Tcl command whose name is the same as the path name of the CheckList's window. This command may be used to invoke various operations on the widget. It has the following general form:
pathName option ?arg arg ...?
PathName is the name of the command, which is the same as the CheckList widget's path name. Option and the args determine the exact behavior of the command. The following commands are possible for CheckList widgets:
- pathName getselection ?status?
Returns a list of items whose status matches status. If status is not specified, the list of items in the "on" status will be returned.
- pathName getstatus entryPath
Returns the current status of entryPath.
- pathName setstatus entryPath status
Sets the status of entryPath to be status. A bitmap will be displayed next to the entry its status is on, off or default.
- pathName subwidget name ?args?
When no options are given, this command returns the pathname of the subwidget of the specified name.
When options are given, the widget command of the specified subwidget will be called with these options.
This example creates several choices for the user to select.
set c [tixCheckList .c] $c subwidget hlist add choice1 -itemtype imagetext -text Choice1 $c subwidget hlist add choice2 -itemtype imagetext -text Choice2 $c subwidget hlist add choice3 -itemtype imagetext -text Choice3 $c setstatus choice1 on $c setstatus choice2 off $c setstatus choice3 off pack $c
The basic mouse and keyboard bindings of the CheckList widget are the same as the bindings of the TixTree widget.
In addition, the status of the entries in the CheckList are toggled under the following conditions:
When the user press the mouse button over an entry.
When the user press the <space> key over an entry.
When the user press the <Return> key over an entry.
Tix(n), tixHList(n), tixTree(n)