1 |
578 |
markom |
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
<TITLE>tixTree - Create and manipulate tixTree widgets</TITLE>
|
5 |
|
|
<Center><H2>tixTree - Create and manipulate tixTree widgets</H2></Center><hr>
|
6 |
|
|
|
7 |
|
|
</pre><H3>SYNOPSIS</H3>
|
8 |
|
|
<B>tixTree<I> <I>pathName ?<I>options</I></B>?
|
9 |
|
|
<P>
|
10 |
|
|
</pre><H3>SUPER-CLASS</H3>
|
11 |
|
|
The <B>TixTree</B></I> class is derived from the <B>TixScrolledHList</B></I>
|
12 |
|
|
class and inherits all the commands, options and subwidgets of its
|
13 |
|
|
super-class.
|
14 |
|
|
</pre><H3>STANDARD OPTIONS</H3>
|
15 |
|
|
<B>TixTree</B></I> supports all the standard options of a frame widget.
|
16 |
|
|
See the <B>options(n)</B></I> manual entry for details on the standard options.
|
17 |
|
|
</pre><H3>WIDGET-SPECIFIC OPTIONS</H3>
|
18 |
|
|
<P>
|
19 |
|
|
<pre><code><code><code>
|
20 |
|
|
Name: <B>browseCmd</B></I>
|
21 |
|
|
Class: <B>BrowseCmd</B></I>
|
22 |
|
|
Switch: <B>-browsecmd</B></I>
|
23 |
|
|
</code></code></code></pre>
|
24 |
|
|
<UL>
|
25 |
|
|
Specifies a command to call whenever the user browses on an entry
|
26 |
|
|
(usually by single-clicking on the entry). The command is called with
|
27 |
|
|
one argument, the pathname of the entry.
|
28 |
|
|
</UL>
|
29 |
|
|
<P>
|
30 |
|
|
<pre><code><code><code>
|
31 |
|
|
Name: <B>closeCmd</B></I>
|
32 |
|
|
Class: <B>CloseCmd</B></I>
|
33 |
|
|
Switch: <B>-closecmd</B></I>
|
34 |
|
|
</code></code></code></pre>
|
35 |
|
|
<UL>
|
36 |
|
|
Specifies a command to call whenever an entry needs to be closed (See
|
37 |
|
|
the BINDINGS section below). This command is called with one argument,
|
38 |
|
|
the pathname of the entry. This command should perform appropriate
|
39 |
|
|
actions to close the specified entry. If the <B>-closecmd</B></I> option
|
40 |
|
|
is not specified, the default closing action is to hide all child
|
41 |
|
|
entries of the specified entry.
|
42 |
|
|
</UL>
|
43 |
|
|
<P>
|
44 |
|
|
<pre><code><code><code>
|
45 |
|
|
Name: <B>command</B></I>
|
46 |
|
|
Class: <B>Command</B></I>
|
47 |
|
|
Switch: <B>-command</B></I>
|
48 |
|
|
</code></code></code></pre>
|
49 |
|
|
<UL>
|
50 |
|
|
Specifies a command to call whenever the user activates an entry
|
51 |
|
|
(usually by double-clicking on the entry). The command
|
52 |
|
|
is called with one argument, the pathname of the entry.
|
53 |
|
|
</UL>
|
54 |
|
|
<P>
|
55 |
|
|
<pre><code><code><code>
|
56 |
|
|
Name: <B>ignoreInvoke</B></I>
|
57 |
|
|
Class: <B>IgnoreInvoke</B></I>
|
58 |
|
|
Switch: <B>-ignoreinvoke</B></I>
|
59 |
|
|
</code></code></code></pre>
|
60 |
|
|
<UL>
|
61 |
|
|
A Boolean value that specifies when a branch should be opened or
|
62 |
|
|
closed. A branch will always be opened or closed when the user presses
|
63 |
|
|
the (+) and (-) indicators. However, when the user invokes a branch
|
64 |
|
|
(by doublc-clicking or pressing <Return>), the branch will be opened
|
65 |
|
|
or closed only if <B>-ignoreinvoke</B></I> is set to false (the default
|
66 |
|
|
setting).
|
67 |
|
|
|
68 |
|
|
</UL>
|
69 |
|
|
<P>
|
70 |
|
|
<pre><code><code><code>
|
71 |
|
|
Name: <B>openCmd</B></I>
|
72 |
|
|
Class: <B>OpenCmd</B></I>
|
73 |
|
|
Switch: <B>-opencmd</B></I>
|
74 |
|
|
</code></code></code></pre>
|
75 |
|
|
<UL>
|
76 |
|
|
Specifies a command to call whenever an entry needs to be opened (See
|
77 |
|
|
the BINDINGS section below). This command is called with one argument,
|
78 |
|
|
the pathname of the entry. This command should perform appropriate
|
79 |
|
|
actions to open the specified entry. If the <B>-opencmd</B></I> option
|
80 |
|
|
is not specified, the default opening action is to show all the child
|
81 |
|
|
entries of the specified entry.
|
82 |
|
|
</UL>
|
83 |
|
|
</pre><H3>SUBWIDGETS</H3>
|
84 |
|
|
<P>
|
85 |
|
|
<pre><code><code><code>
|
86 |
|
|
Name: <B>hlist</B></I>
|
87 |
|
|
Class: <B>TixHList</B></I>
|
88 |
|
|
</code></code></code></pre>
|
89 |
|
|
<UL>
|
90 |
|
|
The hierarchical listbox that displays the tree.
|
91 |
|
|
</UL>
|
92 |
|
|
<P>
|
93 |
|
|
<pre><code><code><code>
|
94 |
|
|
Name: <B>hsb</B></I>
|
95 |
|
|
Class: <B>Scrollbar</B></I>
|
96 |
|
|
</code></code></code></pre>
|
97 |
|
|
<UL>
|
98 |
|
|
The horizontal scrollbar subwidget.
|
99 |
|
|
</UL>
|
100 |
|
|
<P>
|
101 |
|
|
<pre><code><code><code>
|
102 |
|
|
Name: <B>vsb</B></I>
|
103 |
|
|
Class: <B>Scrollbar</B></I>
|
104 |
|
|
</code></code></code></pre>
|
105 |
|
|
<UL>
|
106 |
|
|
The vertical scrollbar subwidget.
|
107 |
|
|
</UL>
|
108 |
|
|
</pre><HR>
|
109 |
|
|
</pre><H3>DESCRIPTION</H3>
|
110 |
|
|
<P>
|
111 |
|
|
The <B>tixTree</B></I> command creates a new window (given by the
|
112 |
|
|
<I>pathName</I></B> argument) and makes it into a Tree widget. Additional
|
113 |
|
|
options, described above, may be specified on the command line or in
|
114 |
|
|
the option database to configure aspects of the Tree widget such as its
|
115 |
|
|
cursor and relief.
|
116 |
|
|
|
117 |
|
|
The Tree widget can be used to display hierachical data in a tree
|
118 |
|
|
form. The user can adjust the view of the tree by opening or closing
|
119 |
|
|
parts of the tree.
|
120 |
|
|
|
121 |
|
|
To display a static tree structure, you can add the entries into the
|
122 |
|
|
<B>hlist</B></I> subwidget and hide any entries as desired. Then you can
|
123 |
|
|
call the <B>autosetmode</B></I> method. This will set up the Tree widget so
|
124 |
|
|
that it handles all the <I>open</I></B> and <I>close</I></B> events
|
125 |
|
|
automatically. (Please see the demonstration program
|
126 |
|
|
demos/samples/Tree.tcl).
|
127 |
|
|
|
128 |
|
|
The above method is not applicable if you want to maintain a dynamic
|
129 |
|
|
tree structure, i.e, you do not know all the entries in the tree and
|
130 |
|
|
you need to add or delete entries subsequently. To do this, you should
|
131 |
|
|
first create the entries in the <B>hlist</B></I> subwidget. Then, use the
|
132 |
|
|
setmode method to indicate the entries that can be opened or closed,
|
133 |
|
|
and use the <B>-opencmd</B></I> and <B> -closecmd</B></I> options to handle
|
134 |
|
|
the opening and closing events. (Please see the demonstration program
|
135 |
|
|
demos/samples/DynTree.tcl demo).
|
136 |
|
|
</pre><H3>WIDGET COMMANDS</H3>
|
137 |
|
|
<P>
|
138 |
|
|
The <B>tixTree</B></I> command creates a new Tcl command whose name is the
|
139 |
|
|
to invoke various operations on the widget. It has the following
|
140 |
|
|
general form:
|
141 |
|
|
<pre>
|
142 |
|
|
<I>pathName option </I></B>?<I>arg arg ...</I></B>?
|
143 |
|
|
<P>
|
144 |
|
|
</pre>
|
145 |
|
|
<I>PathName</I></B> is the name of the command, which is the same as the
|
146 |
|
|
determine the exact behavior of the command. The following commands
|
147 |
|
|
are possible for Tree widgets:
|
148 |
|
|
<DL>
|
149 |
|
|
<DT> <I>pathName <B>autosetmode</B></I>
|
150 |
|
|
</I></B>
|
151 |
|
|
<DD> This command calls the <B>setmode</B></I> method for all the entries in
|
152 |
|
|
this Tree widget: if an entry has no child entries, its mode is set to
|
153 |
|
|
<B>none</B></I>. Otherwise, if the entry has any hidden child entries, its
|
154 |
|
|
mode is set to <B>open</B></I>; otherwise its mode is set to <B>close</B></I>.
|
155 |
|
|
</DL>
|
156 |
|
|
<DL>
|
157 |
|
|
<DT> <I>pathName <B>cget</B></I> <I>option</I></B>
|
158 |
|
|
</I></B>
|
159 |
|
|
<DD> Returns the current value of the configuration option given by
|
160 |
|
|
<I>option</I></B>. <I>Option</I></B> may have any of the values accepted by the
|
161 |
|
|
<B>tixTree</B></I> command.
|
162 |
|
|
</DL>
|
163 |
|
|
<DL>
|
164 |
|
|
<DT> <I>pathName <B>close <I>entryPath</I></B>
|
165 |
|
|
</I></B>
|
166 |
|
|
<DD> Close the entry given by <I>entryPath</I></B> if its <I>mode</I></B> is <B>close</B></I>.
|
167 |
|
|
</DL>
|
168 |
|
|
<DL>
|
169 |
|
|
<DT> <I>pathName <B>configure</B></I> ?<I>option</I></B>? <I>?value option value ...</I></B>?
|
170 |
|
|
</I></B>
|
171 |
|
|
<DD> Query or modify the configuration options of the widget. If no
|
172 |
|
|
<I>option</I></B> is specified, returns a list describing all of the
|
173 |
|
|
available options for <I>pathName</I></B> (see <B>Tk_ConfigureInfo</B></I> for
|
174 |
|
|
information on the format of this list). If <I>option</I></B> is specified
|
175 |
|
|
with no <I>value</I></B>, then the command returns a list describing the
|
176 |
|
|
one named option (this list will be identical to the corresponding
|
177 |
|
|
sublist of the value returned if no <I>option</I></B> is specified). If
|
178 |
|
|
one or more <I>option-value</I></B> pairs are specified, then the command
|
179 |
|
|
modifies the given widget option(s) to have the given value(s); in
|
180 |
|
|
this case the command returns an empty string. <I>Option</I></B> may have
|
181 |
|
|
any of the values accepted by the <B>tixTree</B></I> command.
|
182 |
|
|
</DL>
|
183 |
|
|
<DL>
|
184 |
|
|
<DT> <I>pathName <B>getmode <I>entryPath</I></B>
|
185 |
|
|
</I></B>
|
186 |
|
|
<DD> Returns the current <I>mode</I></B> of the entry given by <I>entryPath</I></B>.
|
187 |
|
|
</DL>
|
188 |
|
|
<DL>
|
189 |
|
|
<DT> <I>pathName <B>open <I>entryPath</I></B>
|
190 |
|
|
</I></B>
|
191 |
|
|
<DD> Open the entry givaen by <I>entryPath</I></B> if its <I>mode</I></B> is <B>open</B></I>.
|
192 |
|
|
</DL>
|
193 |
|
|
<DL>
|
194 |
|
|
<DT> <I>pathName <B>setmode <I> entryPath mode</I></B>
|
195 |
|
|
</I></B>
|
196 |
|
|
<DD> This command is used to indicate whether the entry given by
|
197 |
|
|
<I>entryPath</I></B> has children entries and whether the children are
|
198 |
|
|
visible. <I>mode</I></B> must be one of <B>open</B></I>,
|
199 |
|
|
<B>close</B></I> or <B>none</B></I>. If <I>mode</I></B> is set to <B>open</B></I>, a (+)
|
200 |
|
|
indicator is drawn next the the entry. If <I>mode</I></B> is set to
|
201 |
|
|
<B>close</B></I>, a (-) indicator is drawn next the the entry. If
|
202 |
|
|
<I>mode</I></B> is set to <B>none</B></I>, no indicators will be drawn for this
|
203 |
|
|
entry. The default <I>mode</I></B> is none. The <B>open</B></I> mode indicates
|
204 |
|
|
the entry has hidden children and this entry can be opened by the
|
205 |
|
|
user. The <B>close</B></I> mode indicates that all the children of the entry
|
206 |
|
|
are now visible and the entry can be closed by the user.
|
207 |
|
|
</DL>
|
208 |
|
|
<DL>
|
209 |
|
|
<DT> <I>pathName <B>subwidget <I> name ?args?</I></B>
|
210 |
|
|
</I></B>
|
211 |
|
|
<DD> When no options are given, this command returns the pathname of the
|
212 |
|
|
subwidget of the specified name.
|
213 |
|
|
|
214 |
|
|
When options are given, the widget command of the specified subwidget
|
215 |
|
|
will be called with these options.
|
216 |
|
|
</DL>
|
217 |
|
|
</pre><H3>BINDINGS</H3>
|
218 |
|
|
<P>
|
219 |
|
|
The basic mouse and keyboard bindings of the Tree widget are the same
|
220 |
|
|
as the bindings of the HList widget.
|
221 |
|
|
|
222 |
|
|
In addition, the entries can be opened or closed under the following
|
223 |
|
|
conditions:
|
224 |
|
|
<UL>
|
225 |
|
|
[1] <BR>
|
226 |
|
|
If the <I>mode</I></B> of the entry is <B>open</B></I>, it can be opened by clicking
|
227 |
|
|
on its (+) indicator or double-clicking on the entry.
|
228 |
|
|
</UL>
|
229 |
|
|
<UL>
|
230 |
|
|
[2] <BR>
|
231 |
|
|
If the <I>mode</I></B> of the entry is <B>close</B></I>, it can be closed by clicking
|
232 |
|
|
on its (-) indicator or double-clicking on the entry.
|
233 |
|
|
</UL>
|
234 |
|
|
</pre><H3>KEYWORDS</H3>
|
235 |
|
|
Tix(n),tixHList(n)
|
236 |
|
|
<hr><i>Last modified Sun Jan 19 22:34:40 EST 1997 </i> ---
|
237 |
|
|
<i>Serial 853731306</i>
|