1tixTree(n) Tix Built-In Commands tixTree(n)
2
3
4
6 tixTree - Create and manipulate tixTree widgets
7
9 tixTree pathName ?options?
10
12 The TixTree class is derived from the TixScrolledHList class and inher‐
13 its all the commands, options and subwidgets of its super-class.
14
16 TixTree supports all the standard options of a frame widget. See the
17 options(n) manual entry for details on the standard options.
18
20 [-browsecmd browseCmd] Specifies a command to call whenever the user
21 browses on an entry (usually by single-clicking on the entry). The com‐
22 mand is called with one argument, the pathname of the entry.
23 [-closecmd closeCmd] Specifies a command to call whenever an entry
24 needs to be closed (See the BINDINGS section below). This command is
25 called with one argument, the pathname of the entry. This command
26 should perform appropriate actions to close the specified entry. If the
27 -closecmd option is not specified, the default closing action is to
28 hide all child entries of the specified entry. [-command command]
29 Specifies a command to call whenever the user activates an entry (usu‐
30 ally by double-clicking on the entry). The command is called with one
31 argument, the pathname of the entry. [-ignoreinvoke ignoreInvoke] A
32 Boolean value that specifies when a branch should be opened or closed.
33 A branch will always be opened or closed when the user presses the (+)
34 and (-) indicators. However, when the user invokes a branch (by doublc-
35 clicking or pressing <Return>), the branch will be opened or closed
36 only if -ignoreinvoke is set to false (the default setting).
37
38 [-opencmd openCmd] Specifies a command to call whenever an entry needs
39 to be opened (See the BINDINGS section below). This command is called
40 with one argument, the pathname of the entry. This command should per‐
41 form appropriate actions to open the specified entry. If the -opencmd
42 option is not specified, the default opening action is to show all the
43 child entries of the specified entry.
44
46 Name: hlist
47 Class: TixHList
48
49 The hierarchical listbox that displays the tree.
50
51 Name: hsb
52 Class: Scrollbar
53
54 The horizontal scrollbar subwidget.
55
56 Name: vsb
57 Class: Scrollbar
58
59 The vertical scrollbar subwidget.
60
62 The tixTree command creates a new window (given by the pathName argu‐
63 ment) and makes it into a Tree widget. Additional options, described
64 above, may be specified on the command line or in the option database
65 to configure aspects of the Tree widget such as its cursor and relief.
66
67 The Tree widget can be used to display hierachical data in a tree form.
68 The user can adjust the view of the tree by opening or closing parts of
69 the tree.
70
71 To display a static tree structure, you can add the entries into the
72 hlist subwidget and hide any entries as desired. Then you can call the
73 autosetmode method. This will set up the Tree widget so that it handles
74 all the open and close events automatically.
75
76 The above method is not applicable if you want to maintain a dynamic
77 tree structure, i.e, you do not know all the entries in the tree and
78 you need to add or delete entries subsequently. To do this, you should
79 first create the entries in the hlist subwidget. Then, use the setmode
80 method to indicate the entries that can be opened or closed, and use
81 the -opencmd and -closecmd options to handle the opening and closing
82 events.
83
85 The tixTree command creates a new Tcl command whose name is the same as
86 the path name of the Tree's window. This command may be used to invoke
87 various operations on the widget. It has the following general form:
88 pathName option ?arg arg ...?
89 PathName is the name of the command, which is the same as the Tree wid‐
90 get's path name. Option and the args determine the exact behavior of
91 the command. The following commands are possible for Tree widgets:
92
93 pathName autosetmode
94 This command calls the setmode method for all the entries in
95 this Tree widget: if an entry has no child entries, its mode is
96 set to none. Otherwise, if the entry has any hidden child
97 entries, its mode is set to open; otherwise its mode is set to
98 close.
99
100 pathName cget option
101 Returns the current value of the configuration option given by
102 option. Option may have any of the values accepted by the tix‐
103 Tree command.
104
105 pathName close entryPath
106 Close the entry given by entryPath if its mode is close.
107
108 pathName configure ?option? ?value option value ...?
109 Query or modify the configuration options of the widget. If no
110 option is specified, returns a list describing all of the avail‐
111 able options for pathName (see Tk_ConfigureInfo for information
112 on the format of this list). If option is specified with no
113 value, then the command returns a list describing the one named
114 option (this list will be identical to the corresponding sublist
115 of the value returned if no option is specified). If one or
116 more option-value pairs are specified, then the command modifies
117 the given widget option(s) to have the given value(s); in this
118 case the command returns an empty string. Option may have any
119 of the values accepted by the tixTree command.
120
121 pathName getmode entryPath
122 Returns the current mode of the entry given by entryPath.
123
124 pathName open entryPath
125 Open the entry givaen by entryPath if its mode is open.
126
127 pathName setmode entryPath mode
128 This command is used to indicate whether the entry given by
129 entryPath has children entries and whether the children are vis‐
130 ible. mode must be one of open, close or none. If mode is set to
131 open, a (+) indicator is drawn next the the entry. If mode is
132 set to close, a (-) indicator is drawn next the the entry. If
133 mode is set to none, no indicators will be drawn for this entry.
134 The default mode is none. The open mode indicates the entry has
135 hidden children and this entry can be opened by the user. The
136 close mode indicates that all the children of the entry are now
137 visible and the entry can be closed by the user.
138
139 pathName subwidget name ?args?
140 When no options are given, this command returns the pathname of
141 the subwidget of the specified name.
142
143 When options are given, the widget command of the specified sub‐
144 widget will be called with these options.
145
147 The basic mouse and keyboard bindings of the Tree widget are the same
148 as the bindings of the HList widget.
149
150 In addition, the entries can be opened or closed under the following
151 conditions:
152
153 [1] If the mode of the entry is open, it can be opened by clicking
154 on its (+) indicator or double-clicking on the entry.
155
156 [2] If the mode of the entry is close, it can be closed by clicking
157 on its (-) indicator or double-clicking on the entry.
158
160 Tix(n),tixHList(n)
161
162
163
164
165
166
167Tix 4.0 tixTree(n)