Name: hlist Class: TixHList
Name: hsb Class: Scrollbar
Name: vsb Class: Scrollbar
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:
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: