TIX(3) | Tix Built-In Commands | TIX(3) |
tixTree - Create and manipulate tixTree widgets
tixTree pathName ?options?
The TixTree class is derived from the TixScrolledHList class and inherits all the commands, options and subwidgets of its super-class.
TixTree 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. [-closecmd closeCmd] Specifies a command to call whenever an entry needs to be closed (See the BINDINGS section below). This command is called with one argument, the pathname of the entry. This command should perform appropriate actions to close the specified entry. If the -closecmd option is not specified, the default closing action is to hide all child entries of the specified 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. [-ignoreinvoke ignoreInvoke] A Boolean value that specifies when a branch should be opened or closed. A branch will always be opened or closed when the user presses the (+) and (-) indicators. However, when the user invokes a branch (by doublc-clicking or pressing <Return>), the branch will be opened or closed only if -ignoreinvoke is set to false (the default setting).
[-opencmd openCmd] Specifies a command to call whenever an entry needs to be opened (See the BINDINGS section below). This command is called with one argument, the pathname of the entry. This command should perform appropriate actions to open the specified entry. If the -opencmd option is not specified, the default opening action is to show all the child entries of the specified entry.
Name: hlist Class: TixHList
Name: hsb Class: Scrollbar
Name: vsb Class: Scrollbar
The tixTree command creates a new window (given by the pathName argument) and makes it into a Tree widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the Tree widget such as its cursor and relief.
The Tree widget can be used to display hierarchical data in a tree form. The user can adjust the view of the tree by opening or closing parts of the tree.
To display a static tree structure, you can add the entries into the hlist subwidget and hide any entries as desired. Then you can call the autosetmode method. This will set up the Tree widget so that it handles all the open and close events automatically.
The above method is not applicable if you want to maintain a dynamic tree structure, i.e, you do not know all the entries in the tree and you need to add or delete entries subsequently. To do this, you should first create the entries in the hlist subwidget. Then, use the setmode method to indicate the entries that can be opened or closed, and use the -opencmd and -closecmd options to handle the opening and closing events.
The tixTree command creates a new Tcl command whose name is the same as the path name of the Tree'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.
The basic mouse and keyboard bindings of the Tree widget are the same as the bindings of the HList widget.
In addition, the entries can be opened or closed under the following conditions:
Tix(n),tixHList(n)
4.0 | Tix |