OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / blt2.5 / man / treeview.mann
1 '\"
2 '\" Copyright 2001-2 by Silicon Metrics Corporation.
3 '\"
4 '\" Permission to use, copy, modify, and distribute this software and its
5 '\" documentation for any purpose and without fee is hereby granted, provided
6 '\" that the above copyright notice appear in all copies and that both that the
7 '\" copyright notice and warranty disclaimer appear in supporting documentation,
8 '\" and that the names of Silicon Metrics or any of their entities not be used
9 '\" in advertising or publicity pertaining to distribution of the software
10 '\" without specific, written prior permission.
11 '\"
12 '\" Silicon Metrics disclaims all warranties with regard to this software,
13 '\" including all implied warranties of merchantability and fitness.  In no event
14 '\" shall Silicon Metrics be liable for any special, indirect or
15 '\" consequential damages or any damages whatsoever resulting from loss of use,
16 '\" data or profits, whether in an action of contract, negligence or other
17 '\" tortuous action, arising out of or in connection with the use or performance
18 '\" of this software.  
19 '\"
20 '\" The hierarchical table widget created by George Howlett.
21 '\" Extensive cleanups and enhancements by Peter MacDonald.
22 '\"
23 .so man.macros
24 .TH treeview n BLT_VERSION BLT "BLT Built-In Commands"
25 .BS
26 '\" Note:  do not modify the .SH NAME line immediately below!
27 .SH NAME
28 treeview \- Create and manipulate hierarchical table widgets
29 .BE
30 .SH SYNOPSIS
31 \fBtreeview\fR \fIpathName \fR?\fIoptions\fR?
32 .SH DESCRIPTION
33 The \fBtreeview\fR widget displays a \fBtree\fR of data with
34 styles, tags, and data sharing (via \fItree data objects\fR).
35 .SH INTRODUCTION
36 The \fBtreeview\fR widget manages a collection of entries
37 where each entry contains a \fBtree\fR node plus added style and
38 attribute information.
39 .PP
40 Entries are usually inserted into a treeview with a label-list to specify
41 the unique hierarchical position relative to \fBroot\fR
42 (or the \fB-at\fR node);
43 The tail of this label-list is unique within its hierarchical level.
44 If no label is given, the generated node-id is used as the label.
45 Labels provide a convenient way to index
46 entries using the \fB->\fR notation.
47 eg.
48 .PP
49 .CS
50  treeview .t
51  .t insert end
52  .t insert end X
53  .t insert end A {A a} {A b} B C
54  .t insert end a b c {c i} {c ii}   -at root->B
55  set id [.t index root->B->c->i]
56  puts [.t get $id];        # outputs i
57  puts [.t get -full $id];  # outputs {B c i}
58  pack .t
59 .CE
60 .SH "COLUMN DATA"
61 Column data can be stored within an entry using the \fB-data\fR option
62 or \fBentry\fR sub-commands, eg.
63 .PP
64 .CS
65  treeview .t
66  .t column insert end X Y Z
67  .t insert end A -data {X 1 Y 2}
68  .t insert end B -data {X 3 Y 4 Z 5}
69  .t entry conf root->B -data {X 5 Y 4 Z 3}
70  .t entry set  root->A Z 3
71  .t entry incr root->B Y
72  pack .t
73 .CE
74 .PP
75 Labels can be created with auto-generated sequence numbers
76 using an empty string or a trailing \fB#auto\fR.
77 .PP
78 .CS
79  treeview .t
80  .t column insert end X
81  .t insert end {}       -data {X 0};   # Label is "1"
82  .t insert end #auto    -data {X 1};   # Label is "2"
83  .t insert end Foo#auto -data {X 2};   # Label is "Foo1"
84  pack .t
85 .CE
86 .SH "TREE DATA OBJECT"
87 Node data in treeview is actually stored in a tree data object,
88 which separates data storage from widget appearance.
89 The \fB-tree\fR option can be used to explictly set a tree
90 (externally created with the \fBtree\fR command) thus
91 giving access to trees more extensive data manipulation facilities, eg.
92 .PP
93 .CS
94  set t [tree create]
95  $t insert root -label A
96  $t insert root->A -label B -data {X 1}
97  treeview .t -tree $t
98  .t column insert end X
99  pack .t
100 .CE
101 .PP
102 A tree can also be attached to a treeview, eg.
103 .PP
104 .CS
105  set t [tree create]
106  $t attach [.t cget -tree]
107  set dump [$t dump root]
108  tree destroy $t
109 .CE
110 .PP
111 Note that when inserting data via the \fBtree\fR sub-commands,
112 unique label checking is not performed.
113 .SH SYNTAX
114 .DS
115 \fBtreeview \fIpathName \fR?\fIoption value\fR?...
116 .DE
117 The \fBtreeview\fR command creates a new window \fIpathName\fR and
118 makes it into a \fBtreeview\fR widget.  At the time this command is
119 invoked, there must not exist a window named \fIpathName\fR, but
120 \fIpathName\fR's parent must exist.  Additional options may be
121 specified on the command line or in the option database to configure
122 aspects of the widget such as its colors and font.  See the
123 \fBconfigure\fR operation below for the exact details about what
124 \fIoption\fR and \fIvalue\fR pairs are valid.
125 .PP
126 If successful, \fBtreeview\fR returns the path name of the widget.  It
127 also creates a new Tcl command by the same name.  You can use this
128 command to invoke various operations that query or modify the widget.
129 The operations available are described in the
130 .SB "TREEVIEW OPERATIONS"
131 section.
132 .PP
133 Treeview displays nodes as row entries in the widget.  Each entry has a
134 text label and icon.  When a node has children, its entry is drawn
135 with a small button to the left of the label.  Clicking the mouse over
136 this button opens or closes the node.  When a node is \fIopen\fR, its
137 children are exposed.  When it is \fIclosed\fR, the children and their
138 descedants are hidden.  The button is normally a \fB+\fR or
139 \fB\-\fR symbol (ala Windows Explorer), but can be replaced with a
140 pair of Tk images (open and closed images).
141 .PP
142 If the node has data associated with it, they can be displayed in
143 columns running vertically on either side the tree.
144 You can control
145 the color, font, etc of each entry.  Any entry label or data field can
146 be edited in-place.
147
148 .SH "IDS AND TAGS"
149 Nodes can be inserted into a tree using the \fBtreeview\fR widget 
150 .PP
151 .CS
152   blt::treeview .t
153   set node [.t insert end "one"]
154 .CE
155 .PP
156 or \fBtree\fR command. 
157 .PP
158 .CS
159  set tree [blt::tree create]
160  set node [$tree insert root -label "one"]
161  blt::treeview .t -tree $tree
162 .CE
163 .PP
164 In both cases, a number identifying the node is returned (the value of
165 \fB$node\fR).  This serial number or \fIid\fR uniquely identifies
166 the node.  Please note that you can't infer a location or position of
167 a node from its id.  The only exception is that the root node is
168 always id \fB0\fR. Since nodes may have the same labels or be moved
169 within the tree, ids provide an convenient way to identify nodes.  If
170 a tree is shared, the ids will be the same regardless if you are using
171 by the \fBtreeview\fR widget or the \fBtree\fR command.  Ids are
172 recycled only when all nodes are deleted.
173 .PP
174 A node may also have any number of \fItags\fR associated with it.  A
175 tag is just a string of characters, and it may take any form except
176 that of an integer.  For example, "\fBx123\fR" is valid, but
177 "\fB123\fR" isn't.  The same tag may be associated with many
178 different nodes.  This is typically done to associate a group of
179 nodes.  Many operations in the \fBtreeview\fR widget take either node
180 ids or tag names as arguments.  Using a tag means apply the operation
181 to all nodes with that tag.
182 .PP
183 Commands that take a \fItagnode\fR
184 will also accept a list of zero or more integer node numbers (node-list).
185 A node-list consist of space separated integers, without leading spaces.
186 Node lists can simplify the use of iterating commands and
187 are used widely in the \fBtree\fR command.
188 .PP
189 There are four built-in or psuedo tags:
190 .RS
191 .TP 1i
192 \fBall\fR
193 Applies to every node in the tree.
194 .TP 1i
195 \fBnonroot\fR
196 Applies to every node in the tree except the root node.
197 .TP 1i
198 \fBrootchildren\fR
199 Applies to every node in the tree whose parent is the root node.
200 .TP 1i
201 \fBroot\fR
202 Managed automatically by the tree object, \fBroot\fR specifies the node
203 that is currently set as the root node for the tree.
204 .RE
205 .PP
206 Tags are shared between clients.  This means for example that
207 tags created by the \fBtree\fR command are available in the
208 \fBtreeview\fR widget.
209 .SH SPECIAL NODE IDS
210 There are several special non-numeric ids.  Special ids differ
211 from tags in that they are always translated to a single numeric node.
212 They also take precedence over tags.  For example, you
213 can't use a tag name that is a special id.  These ids are specific to
214 the \fBtreeview\fR widget.
215 .TP 15
216 \fBactive\fR
217 The node where the mouse pointer is currently located.
218 When a node is active, it is drawn using its active icon 
219 (see the \fB\-activeicon\fR option).
220 The \fBactive\fR id is changed automatically by moving the mouse
221 pointer over another node or by using the \fBentry activate\fR
222 operation. Note that there can be only one active node at a time.
223 .TP 15
224 \fBanchor\fR
225 The node representing the fixed end of the current selection.  
226 The anchor is set by the \fBselection anchor\fR operation.
227 .TP 15
228 \fBbottom\fR
229 The last viewable node.
230 .TP 15
231 \fBcurrent\fR
232 The node where the mouse pointer is currently located.
233 But unlike \fBactive\fR, this id changes while the
234 selection is dragged.  It is used to determine the
235 current node during button drags.
236 .TP 15
237 \fBdown\fR
238 The next open node from the current focus. The \fBdown\fR of
239 the last open node is the same.
240 .TP 15
241 \fBend\fR
242 The last node at depth 1 in tree.  
243 .TP 15
244 \fBfocus\fR
245 The node that currently has focus.  When a node has focus,
246 it receives key events.  To indicate focus, the node
247 is drawn with a dotted line around its label.  You can change the 
248 focus using the \fBfocus\fR operation.
249 .TP 15
250 \fBlast\fR
251 Same as \fBtail\fR.
252 .TP 15
253 \fBmark\fR
254 The node representing the non-fixed end of the current selection.  
255 The mark is set by the \fBselection mark\fR operation.
256 .TP 15
257 \fBnext\fR
258 The next open node from the current focus.  But unlike \fBdown\fR,
259 when the focus is on last open node, \fBnext\fR wraps around to the 
260 root node.
261 .TP 15
262 \fBnextsibling\fR
263 The next sibling from the node with the current focus.  If the node
264 is already the last sibling then it is the \fBnextsibling\fR.
265 .TP 15
266 \fBparent\fR
267 The parent of the node with the current focus. The \fBparent\fR
268 of the root is also the root.
269 .TP 15
270 \fBprev\fR
271 The last open node from the current focus. But unlike \fBup\fR,
272 when the focus is at root, \fBlast\fR wraps around to the last
273 open node in the tree.
274 .TP 15
275 \fBprevsibling\fR
276 The previous sibling from the node with the current focus.  If the node
277 is already the first sibling then it is the \fBprevsibling\fR.
278 .TP 15
279 \fBroot\fR
280 The root node. You can also use id \fB0\fR to indicate
281 the root.
282 .TP 15
283 \fBtail\fR
284 The last node in the tree, viewable or not.
285 .TP 15
286 \fBtop\fR
287 The first node.
288 .TP 15
289 \fBup\fR
290 The last open node (in depth-first order) from the current focus. The
291 \fBup\fR of the root node (i.e. the root has focus) is also the root.
292 .TP 15
293 \fBview.top\fR
294 First node that's current visible in the widget.
295 .TP 15
296 \fBview.bottom\fR
297 Last node that's current visible in the widget.
298 .TP 15
299 \fB@\fIx\fB,\fIy\fR
300 Indicates the node that covers the point in the treeview window
301 specified by \fIx\fR and \fIy\fR (in pixel coordinates).  If no
302 part of the entryd covers that point, then the closest node to that
303 point is used.
304 .TP 15
305 \fB\fIID\fB->\fILABEL\fR->\fILABEL\fR...
306 Lookup via node labels, eg. \fI0->Main->Users\fR.
307 Quotes can be used around labels that use reserved words or contain
308 spaces, eg. \fI0->"Main"->'User Groups'\fR.
309 See the \fBtree\fR man page for more details.
310 .PP
311 A node may be specified as an id or tag. If the specifier is an
312 integer then it is assumed to refer to the single node with that id.
313 If the specifier is not an integer, it's checked to see if it's a
314 special id (such as focus).  Otherwise, it's assumed to be tag.  Some
315 operations only operate on a single node at a time; if a tag refers to
316 more than one node, then an error is generated.
317 .SH DATA FIELDS
318 Nodes in treeview can manage \fIdata fields\fR associated with columns.
319 Data is displayed in columns running on either side of the
320 displayed tree.  Any node that doesn't have a
321 specific field will show as blank.  Columns can (interactively) be resized,
322 hidden, and, moved.
323 .PP
324 Nodes can contain disjoint data fields (they aren't required to set all
325 fields).  And data manipulated via the \fBtree\fR command
326 does not require an associated treeview column at all.
327 .SH ARRAY REFERENCES
328 Like \fBtree\fR, \fBtreeview\fR supports accessing data
329 sub-fields with an \fIarray notation\fR, eg.
330 .PP
331 .CS
332  treeview .t
333  .t col insert end A
334  .t insert end a -data {A "x 1 y 2 z 3"}
335  .t entry incr  root->a A(x)
336  .t entry set   root->a A(w) 0
337  .t entry unset root->a A(z)
338 .CE
339 .PP
340 Only the following treeview commmands support the \fIarray notation\fR:
341 \fBentry get\fR, \fBentry set\fR, \fBentry incr\fR, \fBentry unset\fR,
342 and \fBfind -column\fR.
343 See \fBtree\fR for more complete support.
344 .SH ENTRY BINDINGS
345 You can bind Tcl commands to be invoked when events occur on nodes
346 (much like Tk canvas items).  You can bind a node using its id or
347 its \fIbindtags\fR.  Bindtags are simply names that associate a
348 binding with one or more nodes.  There is a built-in tag \fBall\fR
349 that all node entries automatically have.
350 .SH "TREEVIEW OPERATIONS"
351 The \fBtreeview\fR operations are the invoked by specifying
352 the widget's pathname, the operation, and any arguments that pertain 
353 to that operation.  The general form is:
354 .sp
355 .CS
356 \fIpathName operation \fR?\fIarg arg ...\fR?
357 .CE
358 .sp
359 \fIOperation\fR and the \fIarg\fRs determine the exact behavior of the
360 command.  The following operation are available for \fBtreeview\fR widgets:
361 .TP
362 \fIpathName \fBbbox\fR ?\fB-screen\fR? \fItagOrId...\fR
363 Returns a list of 4 numbers, representing a bounding box of around
364 the specified entries. The entries is given by one or more \fItagOrId\fR 
365 arguments.  
366 If the \fB\-screen\fR flag is given, then the x-y coordinates
367 of the bounding box are returned as screen coordinates, not 
368 virtual coordinates. Virtual coordinates start from \fB0\fR from the
369 root node and include the title.
370 If the \fB\-world\fR flag is given, then the y coordinate
371 the title height is added in.
372 The returned list contains the following values.
373 .RS
374 .TP 1i
375 \fIx\fR 
376 X-coordinate of the upper-left corner of the bounding box.
377 .TP
378 \fIy\fR
379 Y-coordinate of the upper-left corner of the bounding box.
380 .TP
381 \fIwidth\fR
382 Width of the bounding box.
383 .TP
384 \fIheight\fR
385 Height of the bounding box.
386 .RE
387 .TP
388 \fIpathName \fBbind\fR \fItagName\fR ?\fIsequence command\fR?
389 Associates \fIcommand\fR with \fItagName\fR such that whenever the
390 event sequence given by \fIsequence\fR occurs for a node with this
391 tag, \fIcommand\fR will be invoked.  The syntax is similar to the 
392 \fBbind\fR command except that it operates on \fBtreeview\fR entries, 
393 rather than widgets.
394 The \fItagName\fR can be an entry or tag, or predefined tags such
395 as \fBall\fR, \fBEntry\fR or \fBButton\fR.
396 See the \fBbind\fR manual entry for
397 complete details on \fIsequence\fR and the substitutions performed on 
398 \fIcommand\fR before invoking it.  
399 .sp
400 If all arguments are specified then a new binding is created, replacing 
401 any existing binding for the same \fIsequence\fR and \fItagName\fR.
402 If the first character of \fIcommand\fR is \fB+\fR then \fIcommand\fR 
403 augments an existing binding rather than replacing it. 
404 If no \fIcommand\fR argument is provided then the command currently
405 associated with \fItagName\fR and \fIsequence\fR (it's an error occurs 
406 if there's no such binding) is returned.  If both \fIcommand\fR and 
407 \fIsequence\fR are missing then a list of all the event sequences for 
408 which bindings have been defined for \fItagName\fR. 
409 .TP
410 \fIpathName \fBbutton \fIoperation\fR ?\fIargs\fR?
411 This command is used to control the button selectors within a 
412 \fBtreeview\fR widget.  
413 It has several forms, depending on \fIoperation\fR:
414 .RS
415 .TP
416 \fIpathName \fBbutton activate\fR \fItagOrId\fR
417 Designates the node given by \fItagOrId\fR as active.  
418 When a node is active it's entry is drawn using its active icon 
419 (see the \fB\-activeicon\fR option). 
420 Note that there can be only one active entry at a time.
421 The special id \fBactive\fR indicates the currently active node.
422 .TP
423 \fIpathName \fBbutton bind\fR \fItagName\fR ?\fIsequence command\fR?
424 Associates \fIcommand\fR with \fItagName\fR such that whenever the
425 event sequence given by \fIsequence\fR occurs for an button of a
426 node entry with this tag, \fIcommand\fR will be invoked.  The syntax is
427 similar to the \fBbind\fR command except that it operates on
428 \fBtreeview\fR buttons, rather than widgets. See the \fBbind\fR
429 manual entry for complete details on \fIsequence\fR and the
430 substitutions performed on \fIcommand\fR before invoking it.
431 .sp
432 If all arguments are specified then a new binding is created, replacing 
433 any existing binding for the same \fIsequence\fR and \fItagName\fR.
434 If the first character of \fIcommand\fR is \fB+\fR then \fIcommand\fR 
435 augments an existing binding rather than replacing it. 
436 If no \fIcommand\fR argument is provided then the command currently
437 associated with \fItagName\fR and \fIsequence\fR (it's an error occurs 
438 if there's no such binding) is returned.  If both \fIcommand\fR and 
439 \fIsequence\fR are missing then a list of all the event sequences for 
440 which bindings have been defined for \fItagName\fR. 
441 .TP
442 \fIpathName \fBbutton cget\fR \fIoption\fR
443 Returns the current value of the configuration option given
444 by \fIoption\fR.
445 \fIOption\fR may have any of the values accepted by the \fBconfigure\fR
446 operation described below.
447 .TP
448 \fIpathName \fBbutton configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
449 Query or modify the configuration options of the widget.
450 If no \fIoption\fR is specified, returns a list describing all of
451 the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
452 information on the format of this list).  If \fIoption\fR is specified
453 with no \fIvalue\fR, then the command returns a list describing the
454 one named option (this list will be identical to the corresponding
455 sublist of the value returned if no \fIoption\fR is specified).  If
456 one or more \fIoption\-value\fR pairs are specified, then the command
457 modifies the given widget option(s) to have the given value(s);  in
458 this case the command returns an empty string.
459 \fIOption\fR and \fIvalue\fR are described in the section 
460 .SB "BUTTON OPTIONS" 
461 below.
462 .RE
463 .TP
464 \fIpathName \fBcget\fR \fIoption\fR
465 Returns the current value of the configuration option given
466 by \fIoption\fR.
467 \fIOption\fR may have any of the values accepted by the \fBconfigure\fR
468 operation described below.
469 .TP
470 \fIpathName \fBclose \fR?\fB\-recurse\fR? ?\fB\-trees\fR? \fItagOrId...\fR
471 Closes the node specified by \fItagOrId\fR.  In addition, if a Tcl
472 script was specified by the \fB\-closecommand\fR option, it is
473 invoked.  If the node is already closed, this command has no effect.
474 If the \fB\-recurse\fR flag is present, each child node is
475 recursively closed.
476 The \fB\-trees\fR flag is like \fB\-recurse\fR but operates only on nodes
477 with children, excluding the \fIroot\fR.
478 .TP
479 \fIpathName \fBcolumn \fIoperation\fR ?\fIargs\fR?
480 The following operations are available for treeview columns.
481 .RS
482 .TP
483 \fIpathName \fBcolumn activate\fR \fIcolumn\fR
484 Sets the active column to \fIcolumn\fR.  \fIColumn\fR is the
485 name of a column in the widget.
486 When a column is active, it's drawn using its \fB\-activetitlebackground\fR
487 and \fB\-activetitleforeground\fR options.  If \fIcolumn\fR is the \fB""\fR,
488 then no column will be active.  If no column argument is provided, then
489 the name of the currently active column is returned.
490 .TP
491 \fIpathName \fBcolumn bbox\fR ?\fB-visible\fR? \fIcolumn entry\fR
492 Returns a list of 4 numbers, representing a bounding box of around
493 the specified entries cell. Giving an entry of \fB-1\fR matches the title row.
494 If \fB-visible\fR is given, the width is constrained to not extend
495 past the widgets display.
496 .TP
497 \fIpathName \fBcolumn bind\fR \fIcolumn\fR ?\fIsequence command\fR?
498 These deal with the title part of columns.
499 Associates \fIcommand\fR with \fIcolumn\fR such that whenever the
500 event sequence given by \fIsequence\fR occurs for a column
501 node entry with this tag, \fIcommand\fR will be invoked.  The syntax is
502 similar to the \fBbind\fR command except that it operates on
503 \fBtreeview\fR colunns, rather than widgets. See the \fBbind\fR
504 manual entry for complete details on \fIsequence\fR and the
505 substitutions performed on \fIcommand\fR before invoking it.
506 .TP
507 \fIpathName \fBcolumn cget\fR \fIname\fR \fIoption\fR
508 Returns the current value of the column configuration option given
509 by \fIoption\fR for \fIname\fR.  \fIName\fR is the name of column
510 that corresponds to a data field.
511 \fIOption\fR may have any of the values accepted by the \fBconfigure\fR
512 operation described below.
513 .TP
514 \fIpathName \fBcolumn configure\fR \fIname\fR ?\fIname\fR ...? ?\fIoption\fR? ?\fIvalue option value \fR ...?
515 Query or modify the configuration options of one or more columns
516 \fIname\fR. \fIName\fR is the name of the column corresponding
517 to a data field.
518 If no \fIoption\fR is specified, returns a list describing all of
519 the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
520 information on the format of this list).  If \fIoption\fR is specified
521 with no \fIvalue\fR, then the command returns a list describing the
522 one named option (this list will be identical to the corresponding
523 sublist of the value returned if no \fIoption\fR is specified).  If
524 one or more \fIoption\-value\fR pairs are specified, then the command
525 modifies the given widget option(s) to have the given value(s);  in
526 this case the command returns an empty string.
527 \fIOption\fR and \fIvalue\fR are described in the section
528 .SB "COLUMN OPTIONS" 
529 below.
530 .TP
531 \fIpathName \fBcolumn current\fR
532 Get column currently under the mouse.
533 .TP
534 \fIpathName \fBcolumn delete\fR \fIfield\fR ?\fIfield\fR...?
535 Deletes one of more columns designated by \fIfield\fR.
536 Requests to delete the tree column are silently ignored.
537 Note that this does not delete the data fields themselves.
538 .TP
539 \fIpathName \fBcolumn index\fR \fIindex\fR
540 Return the integer for index.  May use "end" or "end-N".
541 .TP
542 \fIpathName \fBcolumn insert\fR \fIposition\fR \fIfield\fR  ?\fIfield\fR ...? ?\fIoptions\fR...?
543 Inserts one (or more) columns designated by \fIfield\fR.
544 A column displays
545 each entry node's data field using this name.  If the node doesn't
546 define the given field, the cell is left blank.
547 \fIPosition\fR
548 indicates where in the list of columns to add the new column.  It may be
549 either a name, a number or \fBend\fR.
550 If multiple column \fIfields\fR are given, only the first can start with a dash.
551 If \fIfield\fR is the empty string or \fB#auto\fR,
552 a name is generated prefixed by the string \fBCol\fR and a unique integer.
553 If \fIfield\fR ends with \fB#auto\fR, the generated name uses it's prefix
554 instead.
555 The returned values is the created column names.
556 Note that the tree column \fI#0\fR is predefined and can not be deleted.
557 .TP
558 \fIpathName \fBcolumn invoke\fR \fIfield\fR
559 Invokes the Tcl command associated with the column \fIfield\fR, 
560 if there is one (using the column's \fB\-command\fR option).  
561 The command is ignored if the column's \fB\-state\fR option 
562 set to \fBdisabled\fR.
563 .TP
564 \fIpathName \fBcolumn isset ?\fIstartOrTag\fR? ?\fIend\fR?
565 Returns list of data columns for elements in range
566 actually having data values set in them.
567 One possible use for this might be hiding columns which are empty.
568 With no arguments, checks only entries on the visible screen.
569 With one argument, checks all entries matching a tag or id.
570 With two arguments, checks all entries between start and end range.
571 .TP
572 \fIpathName \fBcolumn istree \fIfield\fR
573 Return 1 if column is the tree column.
574 .TP
575 \fIpathName \fBcolumn move \fIname\fR \fIdest\fR 
576 Moves the column \fIname\fR to the destination position.  
577 \fIDest\fR is the offset, name of another column or a screen position
578 in the form \fB@\fIx\fB,\fIy\fR.
579 .TP
580 \fIpathName \fBcolumn names ?\fI-visible\fR? ?\fIPATTERN\fR?
581 Returns a list of the names of all columns in the widget.
582 The list is ordered as the columns are drawn from left-to-right.
583 If -visible, then display only columns where -hide is 0.
584 A pattern may be specified to limit results.
585 .TP
586 \fIpathName \fBcolumn nearest\fR \fIx\fR ?\fIy\fR?
587 Returns the name of the column closest to the given X-Y screen
588 coordinate.  If you provide a \fIy\fR argument (it's optional),
589 a name is returned only when if the point is over a column's title.
590 .TP
591 \fIpathName \fBcolumn offsets\fR
592 Returns the starting offsets for each column.
593 .TP
594 \fIpathName \fBcolumn resize op ...\fR
595 Operations for resize where op is one of activate, anchor, mark or set.
596 .TP
597 \fIpathName \fBcolumn see\fR ?\fB-anchor\fR \fIanchor\fR? \fIfield\fR
598 Adjusts the view so that the column given by \fIfield\fR is
599 visible in the widget window.
600 The node's position on the screen can be set using the
601 \fB\-anchor\fR flag.  Its value is a Tk anchor position: \fBw, c, e\fR.
602 .TP
603 \fIpathName \fBcolumn values\fR ?\fB-visible\fR? ?\fB-default value\fR? \fIfield\fR ?\fIstart\fR? ?\fIend\fR?
604 Returns a list of data values for a column.
605 The -visible flag excludes the values that are hidden or inside closed subtrees.
606 The root nodes does not get included when \fI-hideroot\fR is true.
607 The -default option specifies a value to substitute for unset data column cells.
608 .RE
609 .TP
610 \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
611 Query or modify the configuration options of the widget.
612 If no \fIoption\fR is specified, returns a list describing all of
613 the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
614 information on the format of this list).  If \fIoption\fR is specified
615 with no \fIvalue\fR, then the command returns a list describing the
616 one named option (this list will be identical to the corresponding
617 sublist of the value returned if no \fIoption\fR is specified).  If
618 one or more \fIoption\-value\fR pairs are specified, then the command
619 modifies the given widget option(s) to have the given value(s);  in
620 this case the command returns an empty string.
621 \fIOption\fR and \fIvalue\fR are described in the section
622 .SB "TREEVIEW OPTIONS"
623 below.
624 .TP
625 \fIpathName \fBcurselection\fR
626 Returns a list containing the ids of all of the entries that are 
627 currently selected.
628 If there are no entries selected, then the empty string is returned.
629 .TP
630 \fIpathName \fBdelete \fItagnode\fR...
631 Deletes one or more entries given by \fItagnode\fR and its children.
632 .TP
633 \fIpathName \fBedit ?\fB-test\fR? ?\fB-root\fR? ?\fB-noscroll\fR? ?\fB-scroll\fR? ?\fIX Y\fR?
634 Handle cell editing.
635 The x,y coordinates are usually required, except when using
636 the scroll options.
637 .RS
638 .TP 1i
639 \fB\-noscroll\fR
640 Disable scrolling.  Useful when displaying an edit subwindow.
641 .TP 1i
642 \fB\-scroll\fR
643 Re-enable scrolling.  Usually bound to a destroy event of an edit subwindow.
644 .TP 1i
645 \fB\-root\fR
646 Use root coordinates.
647 .TP 1i
648 \fB\-test\fR
649 Test if edit is complete.
650 .RE
651 .TP
652 \fIpathName \fBentry \fIoperation\fR ?\fIargs\fR?
653 The following operations are available for treeview entries.
654 .RS
655 .TP
656 \fIpathName \fBentry activate\fR \fItagOrId\fR
657 Sets the active entry to the one specified by \fItagOrId\fR.  
658 When an entry is active it is drawn using its active icon 
659 (see the \fB\-activeicon\fR and \fB\-activeleaficon\fR options). 
660 The special id of the currently active node is \fBactive\fR.
661 Note that there can be only one active node at a time and
662 currently icons must be the same size/shape as the backgrounds are not cleared.
663 But \fBbind\fR can be used to overcome these limitations.
664 .TP
665 \fIpathName \fBentry cget\fR \fIoption\fR
666 Returns the current value of the configuration option given
667 by \fIoption\fR.
668 \fIOption\fR may have any of the values accepted by the \fBconfigure\fR
669 operation described below.
670 .TP
671 \fIpathName \fBentry children\fR \fItagOrId\fR  ?\fIfirst\fR? ?\fIlast\fR?
672 Returns a list of ids for the given range of children of \fItagOrId\fR.  
673 \fITagOrId\fR is the id or tag of the node to be examined.
674 If only a \fIfirst\fR argument is present, then the id 
675 of the that child at that numeric position is returned.  If both \fIfirst\fR 
676 and \fIlast\fR arguments are given, then the ids of all the children
677 in that range are returned.  Otherwise the ids of all children
678 are returned.  
679 .TP
680 \fIpathName \fBentry configure\fR \fItagnode\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
681 Query or modify the configuration options of the widget.
682 If no \fIoption\fR is specified, returns a list describing all of
683 the available options for \fItagnode\fR (see \fBTk_ConfigureInfo\fR for
684 information on the format of this list).  If \fIoption\fR is specified
685 with no \fIvalue\fR, then the command returns a list describing the
686 one named option (this list will be identical to the corresponding
687 sublist of the value returned if no \fIoption\fR is specified).  If
688 one or more \fIoption\-value\fR pairs are specified, then the command
689 modifies the given widget option(s) to have the given value(s);  in
690 this case the command returns an empty string.
691 \fIOption\fR and \fIvalue\fR are described below:
692 .TP
693 \fIpathName \fBentry delete\fR \fItagOrId\fR ?\fIfirst\fR ?\fIlast\fR?
694 Deletes the one or more children nodes of the parent \fItagOrId\fR.
695 If \fIfirst\fR and \fIlast\fR arguments are present, they are
696 positions designating a range of children nodes to be deleted.
697 .TP
698 \fIpathName \fBentry depth \fItagOrId\fR
699 Return tree depth of node where root is 0.
700 .TP
701 \fIpathName \fBentry down \fItagOrId\fR
702 The next open node from the given node. The \fBdown\fR of
703 the last open node is the same.
704 .TP
705 \fIpathName \fBentry exists \fItagOrId\fR
706 Return 1 if entry exists.
707 .TP
708 \fIpathName \fBentry get\fR \fItagOrId\fR ?\fIkey\fR? ?\fIdefault\fR?
709 Return a key-field value for an entry.
710 When no \fIkey\fR is given, returns the values of all visible columns.
711 If the given \fIkey\fR is undefined, return \fIdefault\fR if given, else
712 throw an error.
713 Unlike \fBentry set\fR, the tree
714 is accessed directly so keys not having associated columns are supported.
715 .TP
716 \fIpathName \fBentry incr\fR \fItagOrId key\fR ?\fIamount\fR?
717 Increment value by 1 or given \fIamount\fR and return the value.
718 The incr operation normally tries to use integers,
719 but uses doubles when one of
720 value or \fIamount\fR is a double.
721 An array reference may also be used.
722 .TP
723 \fIpathName \fBentry isbefore \fItagOrId1\fR \fItagOrId2\fR
724 Returns 1 if \fItagOrId1\fR is before \fItagOrId2\fR and 0 otherwise.
725 .TP
726 \fIpathName \fBentry ishidden \fItagOrId\fR
727 Returns 1 if the node is currently hidden and 0 otherwise.  A node is
728 also hidden if any of its ancestor nodes are closed or hidden.
729 .TP
730 \fIpathName \fBentry isleaf \fItagOrId\fR
731 Returns 1 if the node is a leaf node.
732 .TP
733 \fIpathName \fBentry isopen \fItagOrId\fR
734 Returns 1 if the node is currently open.
735 .TP
736 \fIpathName \fBentry isset \fR \fItagOrId col\fR
737 Return true if the entry sets a column-field (has a value).
738 The entry and column both must exist.
739 .TP
740 \fIpathName \fBentry isvisible \fItagOrId\fR
741 Returns 1 if node is not hidden, inside a closed subtree.
742 .TP
743 \fIpathName \fBentry next \fItagOrId\fR
744 The next open node from the given node.  But unlike \fBdown\fR,
745 when the focus is on last open node, \fBnext\fR wraps around to the 
746 root node.
747 .TP
748 \fIpathName \fBentry parent \fItagOrId\fR
749 Returns parent of the given node.
750 .TP
751 \fIpathName \fBentry prev \fItagOrId\fR
752 The last open node from the given node. But unlike \fBup\fR,
753 when the focus is at root, \fBlast\fR wraps around to the last
754 open node in the tree.
755 .TP
756 \fIpathName \fBentry relabel \fItagOrId newLabel\fR
757 Change the tree node label associated with an entry.
758 This sets the tree node \fIlabel\fR;
759 ie. the value returned by the \fBget\fR command.
760 Note this is not the same thing as the
761 treeview entries \fB-label\fR option.
762 Also, the \fB-allowduplicates\fR option must be enabled to use this command
763 as no duplicate checking will be performed.
764 .TP
765 \fIpathName \fBentry select \fItagOrId\fR
766 Make the given node visible and give it the focus.
767 When in single selectmode, select it (calls \fI::blt::tv::MoveFocus\fR)
768 .TP
769 \fIpathName \fBentry set \fR \fItagOrId col\fR ?\fIvalue col value ...\fR?
770 Get or set column-fields for an entry.  Provides a simple
771 way to read or update fields from the \fI-data\fR option of an entry.
772 An array reference may also be used.
773 .TP
774 \fIpathName \fBentry sibling ?\fB-before\fR? \fItagOrId\fR
775 The next/previous sibling from the given node.  If the node
776 is already the last/first sibling then nothing is returned.
777 .TP
778 \fIpathName \fBentry size\fR \fB\-recurse\fR \fItagOrId\fR
779 Returns the number of children for parent node \fItagOrId\fR.  
780 If the \fB\-recurse\fR flag is set, the number of all 
781 its descendants is returned.  The node itself is not counted.
782 .TP
783 \fIpathName \fBentry unset \fR \fItagOrId col\fR
784 Unset a column-field for an entry.
785 An array reference may also be used.
786 .TP
787 \fIpathName \fBentry up \fItagOrId\fR
788 The last open node (in depth-first order) from the given node. The
789 \fBup\fR of the last node is itself.
790 .TP
791 \fIpathName \fBentry value \fR \fItagOrId\fR ?\fIcol\fR?
792 Return the value for an entry column, or all visible columns
793 if \fIcol\fR not given.
794 Unlike \fBentry set\fR, this gives access to the formatted value
795 from \fB\-formatcmd\fR (if there was one).
796 .RE
797 .TP
798 \fIpathName \fBfind \fR?\fIflags\fR? \fIfirst\fR \fIlast\fR
799 Finds for all entries matching the criteria given by \fIflags\fR.  A
800 list of ids for all matching nodes is returned. \fIFirst\fR and
801 \fIlast\fR are ids designating the range of the search in
802 depth-first order. If \fIlast\fR is before \fIfirst\fR, then nodes
803 are searched in reverse order.  The valid flags are:
804 .RS
805 .TP 1i
806 \fB\-addtag NAME\fR
807 Add tag to each matching entry.
808 The tag will be created even if no nodes are tagged.
809 .TP 1i
810 \fB\-cmdargs\fR \fIcolumns\fR
811 Specify columns whose values are to be appended to \fB\-command\fR.
812 .TP 1i
813 \fB\-command\fR \fIcommand\fR
814 Invoke \fIcommand\fR for each matching node.  Before \fIcommand\fR is
815 invoked, the id of the node is appended. If \fIcommand\fR
816 generates an error, processing stops and the \fBfind\fR operation
817 returns an error.
818 If \fIcommand\fR returns \fBreturn\fR, then the returned integer 
819 is used to indicate 1 for match or 0 for mismatch.
820 .TP 1i
821 \fB\-column\fI col\fR
822 Match name against value of given column.
823 An array reference may also be used.
824 This option must be used in conjunction with
825 \fI-name\fR and may not be used with \fI-usepath\fR.
826 .TP 1i
827 \fB\-count\fR
828 Just return the number of matches.
829 .TP 1i
830 \fB\-depth\fR \fInumber\fR
831 Entry must be at depth \fInumber\fR.
832 .TP 1i
833 \fB\-exact\fR
834 Patterns must match exactly.  The is the default.
835 .TP 1i
836 \fB\-exec\fI string\fR
837 Specifies a Tcl script to be evaluated for each matching node.
838 If \fB-var\fR was also specified, that variable is set with the value of 
839 the node id before each evaluation.  Otherwise,
840 percent sustitutions are performed: note this is much
841 less efficient than using either \fB-var\fR or \fB-command\fR
842 .sp
843 The result of each eval gets appended to the return list, unless
844 the script issues a CONTINUE, in which case that node is skipped.
845 .sp
846 The available percent substitutions on \fIstring\fR are:
847 .RS 
848 .TP 5
849 \fB%#\fR
850 The id of the node.
851 .TP 5
852 \fB%W\fR
853 The pathname of the widget.
854 .TP 5
855 \fB%p\fR
856 The name of the node.
857 .TP 5
858 \fB%P\fR
859 The full pathname of the node.
860 .TP 5
861 \fB%V\fR
862 The current value (the node name, node label or column value).
863 .TP 5
864 \fB%F\fR
865 Like \fB%V\fR, but returns the on-screen value (from -formatcmd).
866 .TP 5
867 \fB%C\fR
868 The current column.
869 .TP 5
870 \fB%%\fR
871 Translates to a single percent.
872 .RE
873 .TP 1i
874 \fB\-glob\fR
875 Use global pattern matching.  Matching is done in a fashion
876 similar to that used by \fBstring match\fR.
877 .TP 1i
878 \fB\-invert\fR
879 Invert the meaning of the pattern match for \fB-name\fR.
880 .TP 1i
881 \fB\-isclosed\fR
882 Include only entries that are closed.
883 .TP 1i
884 \fB\-isempty\fR
885 Only match nodes where the specified \fB-column\fR key value
886 was unset.
887 .TP 1i
888 \fB\-ishidden\fR
889 Include only entries that are hidden, either because the entry
890 has set -hide, or is has style that is hidden.
891 The root node is not included.
892 .TP 1i
893 \fB\-isleaf\fR
894 Entry must not have child nodes.
895 .TP 1i
896 \fB\-ismapped\fR
897 Include only entries that are currently all or partly drawn on screen.
898 The root node is not included.
899 .TP 1i
900 \fB\-isopen\fR
901 Include only entries that are opened.
902 .TP 1i
903 \fB\-istree\fR
904 Entry must have child nodes.
905 .TP 1i
906 \fB\-limit\fI number\fR
907 Stop searching after \fInumber\fR matches.
908 .TP 1i
909 \fB\-maxdepth\fR
910 Entry must be at depth or lower.
911 .TP 1i
912 \fB\-mindepth\fR
913 Entry must be at depth or higher.
914 .TP 1i
915 \fB\-name\fI pattern\fR
916 Specifies pattern to match against node names.
917 .TP 1i
918 \fB\-nocase\fR
919 Comparisison is ignores case.  For -regexp, the target string
920 gets lower cased (but not the pattern).
921 .TP 1i
922 \fB\-notop\fR
923 Exclude the \fB-top\fR or starting node.
924 .TP 1i
925 \fB\-regexp\fR
926 Use regular expression pattern matching (i.e. the same as implemented
927 by the \fBregexp\fR command).  
928 .TP 1i
929 \fB\-reldepth\fR 
930 Change the meaning of \fB\-depth\fR, \fB\-mindepth\fR and \fB\-maxdepth\fR
931 to be relative to the \fB\-top\fR node.
932 .TP 1i
933 \fB\-return\fI col\fR
934 Instead of the node id, return data value of named column.
935 If \fIcol\fR starts with a %, performs percent substitution
936 as per \fB-command\fR.
937 Note that a percent
938 substitution longer than 2 chars will append values as list elements.
939 .TP 1i
940 \fB\-top \fInode\fR
941 Search is only at \fInode\fR and it's descendants.
942 The default is the root node.
943 .TP 1i
944 \fB\-useformat\fR
945 Compare pattern using \fB\-formatcmd\fR value (if there is one) instead key data value.
946 .TP 1i
947 \fB\-uselabel\fR
948 Compare pattern using label (if there is one) instead last component of path.
949 .TP 1i
950 \fB\-usepath\fR
951 Compare pattern using the full path name.
952 .TP 1i
953 \fB\-userow\fR
954 Compare pattern using the node value plus the values of all keys in the row.
955 If used with \fB-visible\fR, only the visible column keys are used.
956 .TP 1i
957 \fB\-visible\fR
958 Exclude values that are hidden or inside closed subtrees.
959 eg. The root node is excluded if \fI-hideroot\fR is true.
960 .TP 1i
961 \fB\-withouttag NAME\fR
962 Match entries without tag.
963 .TP 1i
964 \fB\-withtag NAME\fR
965 Match entries with tag.
966 .TP 1i  
967 \fB\-var \fIvariable\fR
968 A variable to set with the node id before each iteration of the \fB-exec\fR
969 script.
970 .TP 1i
971 \fB\-option\fR \fIname value\fR
972 Specifies an option name and value
973 to match against the node entry's configuration option.
974 .TP 1i
975 \fB\-\-\fR
976 Indicates the end of flags.
977 .RE
978 .TP
979 \fIpathName \fBfocus \fR?\fItagOrId\fR?
980 Get or set the focus to the node given by \fItagOrId\fR.  When a node
981 has focus, it can receive keyboard events.   
982 The special id \fBfocus\fR designates the node that currently has focus.
983 .TP
984 \fIpathName \fBget\fR ?\fB\-full\fR? ?\fB\-labels\fR? \fItagnode\fR \fItagnode\fR...
985 Translates one or more ids to their node entry names.  It returns a list of 
986 names for all the ids specified.  If the \fB\-full\fR
987 flag is set, then the full pathnames are returned.
988 If the \fB\-labels\fR
989 flag is set, then the full pathnames using labels are returned.  
990 .sp
991 Note: Except when a called with a single node id (ie. an integer),
992 the result will be a list
993 (or list of lists when -separator isn't set).
994 .TP 
995 \fIpathName \fBhide \fR?\fBflags\fR? \fItagOrId\fR...
996 Hides all nodes matching the criteria given by \fIflags\fR.
997 If no \fItagOrId\fR are given, traverses entire tree.
998 The valid flags are described below:
999 .RS
1000 .TP 1i
1001 \fB\-column\fI col\fR
1002 Match name against value of given column.  Must be used with
1003 \fI-name\fR and can not use \fI-usepath\fR.
1004 .TP 1i
1005 \fB\-depth\fR \fInumber\fR
1006 Entry must be at depth \fInumber\fR.
1007 .TP 1i
1008 \fB\-exact\fR
1009 Match patterns exactly.  The is the default.
1010 .TP 1i
1011 \fB\-glob\fR
1012 Use global pattern matching.  Matching is done in a fashion
1013 similar to that used by \fBstring match\fR.
1014 .TP 1i
1015 \fB\-invert\fR
1016 Invert the meaning of the pattern match for \fB-name\fR or \fB-option\fR.
1017 .TP 1i
1018 \fB\-maxdepth\fR
1019 Entry must be at depth or lower.
1020 .TP 1i
1021 \fB\-mindepth\fR
1022 Entry must be at depth or higher.
1023 .TP 1i
1024 \fB\-name\fI pattern\fR
1025 Specifies pattern to match against node names.
1026 .TP 1i
1027 \fB\-nocase\fR
1028 Ignore case in match.
1029 .TP 1i
1030 \fB\-option name value\fR
1031 Specifies an option name and value
1032 to match against the node entry's configuration option.
1033 .TP 1i
1034 \fB\-regexp\fR
1035 Use regular expression pattern matching (i.e. the same as implemented
1036 by the \fBregexp\fR command).  
1037 .TP 1i
1038 \fB\-uselabel\fR
1039 Specifies that the -name pattern is to match the label.
1040 .TP 1i
1041 \fB\-usepath\fR
1042 Specifies that the -name pattern is to match the full path.
1043 .TP 1i
1044 \fB\-withouttag NAME\fR
1045 Match entries with tag.
1046 .TP 1i
1047 \fB\-withtag NAME\fR
1048 Match entries with tag.
1049 .TP 1i
1050 \fB\-\-\fR
1051 Indicates the end of flags.
1052 .RE
1053 .TP
1054 \fIpathName \fBindex \fR?\fB\-at\fR \fItagOrId\fR? ?\fB\-path\fR? ?\fB\-quiet\fR? \fIstring\fR 
1055 Returns the id of the node specified by \fIstring\fR.  \fIString\fR
1056 may be a tag or node id.
1057 Some special ids are normally relative to the node that 
1058 has focus but the \fB\-at\fR option can be used to change this.
1059 The \fB\-path\fR flag does a lookup using \fIString\fR as a path
1060 relative the tree root (unless the \fB\-at\fR option is given).
1061 The the \fB\-quiet\fR flag is given, lookup failures quietly return
1062 the empty string.
1063 .TP
1064 \fIpathName \fBinsert\fR \fIposition\fR ?\fIpath\fR? ?\fIpath\fR? ... ?\fIoptions...\fR? 
1065 Inserts one or more nodes at child \fIposition\fR (a number or \fBend\fR)
1066 in the parent node.
1067 The parent node is either \fBroot\fR or the value given by \fB-at\fR.
1068 The returned value is list of ids for the new entries.
1069 Only the first \fIpath\fR may start with a dash.
1070 .sp
1071 \fIPath\fR is the pathname of the new node.
1072 By default, pathnames are a Tcl list (each element is a path
1073 component) however the \fB\-separator\fR option
1074 can be used to change this.  Pathnames are normally
1075 relative to the root, but the \fB\-at\fR switch lets you select
1076 a different parent node.
1077 If \fIpath\fR is ommitted, it defaults to \fI#auto\fR.
1078 A \fIpath\fR name of \fI#auto\fR will generate a name.
1079 This attempts to use the tree node name as the \fIpath\fR name.
1080 .sp
1081 If the last component of a \fIpath\fR name 
1082 ends in \fI#auto\fR, the path is
1083 generated using the string prefix (before #auto)
1084 followed by a sequential number unique within the
1085 parent, eg. \fB.t insert end {users u#auto}\fR.
1086 .sp
1087 Note that all ancestors of the new node must already exist, unless the
1088 \fB\-autocreate\fR option is set.  It is also an error if a node
1089 already exists, unless the \fB\-allowduplicates\fR option is set.
1090 .sp
1091 For large flat trees setting \fB\-allowduplicates\fR to true 
1092 can greatly speedup loading #auto as it avoids checking overhead.
1093 This is the fastest way to bulk load large numbers of nodes
1094 (next to using \fB-tree\fR).
1095 .sp
1096 The \fIoption\fR arguments
1097 may be any of the values accepted by
1098 \fBentry configure\fR as described in the
1099 .SB "ENTRY OPTIONS"
1100 section below, or any unabbreviated \fBinsert-option\fR.
1101 Note that for multi-node inserts \fBinsert-options\fR will apply
1102 to all following nodes, and only the first \fIpath\fR can start with a dash.
1103 .sp
1104 The valid \fBinsert-options\fR are:
1105 .RS
1106 .TP 8
1107 \fB-at\fR \fInodeid\fR
1108 Specify the parent node to insert entries into.  The default is \fBroot\fR.
1109 .TP 8
1110 \fB-node\fR \fInum\fR
1111 The \fB\-node\fR switch lets you specify a tree node number id
1112 directly instead of having one generating automatically.
1113 For multi-node inserts, the node number gets incremented.
1114 .TP 8
1115 \fB-styles\fR \fIlist\fR
1116 The \fB\-styles\fR switch specifies a list of column/stylename
1117 pairs to set for entries having a \fB\-data\fR option. 
1118 .TP 8
1119 \fB-tags\fR \fIlist\fR
1120 The \fB\-tags\fR switch specifies a list of tags to add
1121 to the new entries.
1122 .RE
1123 .TP
1124 \fIpathName \fBmove \fItagnode\fR \fIhow\fR \fIdestId\fR
1125 Moves the node(s) given by \fItagnode\fR to the destination node.  The
1126 node can not be an ancestor of the destination.  \fIDestId\fR is
1127 the id of the destination node and can not be the root of the
1128 tree.  In conjunction with \fIhow\fR, it describes how the move is
1129 performed.
1130 .RS
1131 .TP 8
1132 \fBbefore\fR
1133 Moves the node before the destination node.
1134 .TP 8
1135 \fBafter\fR
1136 Moves the node after the destination node.
1137 .TP 8
1138 \fBinto\fR
1139 Moves the node to the end of the destination's list of children.
1140 .RE
1141 .TP
1142 \fIpathName \fBnearest\fR  ?\fB-root\fR?  ?\fB-strict\fR? \fIx y\fR ?\fIvarName\fR?
1143 Returns the id of the node entry closest to the given X-Y screen
1144 coordinate.  If the coordinate is not directly over any node, then the
1145 nearest node is returned.  If the argument \fIvarName\fR is present,
1146 this is a Tcl variable that is set to either \fBbutton\fR,
1147 \fBicon\fR, \fBlabel\fR, \fBtitle\fR, \fBtitlelabel\fR, \fBtitleicon\fR, \fBdatalabel\fR, \fBdataicon\fR, or \fB""\fR depending what part of the
1148 entry the coordinate lies.
1149 The -root option subtracts the windows root from the coordinates.
1150 The -strict option fails the match if not directly
1151 over a node, eg. in the title or past end of last row.
1152 .TP
1153 \fIpathName \fBopen \fR?\fB\-recurse\fR? ?\fB\-parent\fR? ?\fB\-trees\fR? \fItagnode...\fR
1154 Opens the one or more nodes specified by \fItagnode\fR.  
1155 If a node is not already open, the Tcl script specified by the 
1156 \fB\-opencommand\fR option is invoked. If the \fB\-recurse\fR flag 
1157 is present, then each descendant is recursively opened.  
1158 The \fB\-trees\fR flag is like \fB\-recurse\fR but operates only on nodes
1159 with children.
1160 The \fB\-parent\fR flag ensures visibility by opening all parent nodes.
1161 .TP
1162 \fIpathName \fBrange\fR ?\fB-open\fR? \fIfirst last\fR
1163 Returns the ids in depth-first order of the nodes
1164 between the \fIfirst\fR and \fIlast\fR ids.  If the \fB\-open\fR
1165 flag is present, it indicates to consider only open nodes.
1166 If \fIlast\fR is before \fIfirst\fR, then the ids are
1167 returned in reverse order.
1168 .TP
1169 \fIpathName \fBscan\fR \fIoption args\fR
1170 This command implements scanning.  It has
1171 two forms, depending on \fIoption\fR:
1172 .RS
1173 .TP
1174 \fIpathName \fBscan mark \fIx y\fR
1175 Records \fIx\fR and \fIy\fR and the current view in the treeview
1176 window;  used in conjunction with later \fBscan dragto\fR commands.
1177 Typically this command is associated with a mouse button press in
1178 the widget.  It returns an empty string.
1179 .TP
1180 \fIpathName \fBscan dragto \fIx y\fR.
1181 Computes the difference between its \fIx\fR and \fIy\fR
1182 arguments and the \fIx\fR and \fIy\fR arguments to the last
1183 \fBscan mark\fR command for the widget.
1184 It then adjusts the view by 10 times the
1185 difference in coordinates.  This command is typically associated
1186 with mouse motion events in the widget, to produce the effect of
1187 dragging the list at high speed through the window.  The return
1188 value is an empty string.
1189 .RE
1190 .TP
1191 \fIpathName \fBsee\fR ?\fB\-anchor \fIanchor\fR? \fItagOrId\fR
1192 Adjusts the view of entries so that the node given by \fItagOrId\fR is
1193 visible in the widget window.  It is an error if \fBtagOrId\fR is a
1194 tag that refers to more than one node.  The node's position
1195 on the screen can be set using the
1196 \fB\-anchor\fR flag.
1197 Its value is \fBw\fR, but can be any one of the Tk anchor positions.
1198 .TP
1199 \fIpathName \fBselection \fIoption arg\fR
1200 This command is used to adjust the selection within a \fBtreeview\fR
1201 widget.  It has several forms, depending on \fIoption\fR:
1202 .RS
1203 .TP
1204 \fIpathName \fBselection anchor ?\fItagOrId\fR? ?\fIcolumn\fR?
1205 Sets the selection anchor to the node given by \fItagOrId\fR.
1206 If \fItagOrId\fR refers to a non-existent node, then the closest
1207 node is used.
1208 The selection anchor is the end of the selection that is fixed
1209 while dragging out a selection with the mouse.
1210 The special id \fBanchor\fR may be used to refer to the anchor
1211 node.  With no arguments, returns anchor entry and column if any.
1212 .TP
1213 \fIpathName \fBselection cells\fR
1214 Returns pairs of nodes and columns for all selected cells.
1215 The -selectmode must be \fIcell\fR or \fImulticell\fR.
1216 .TP
1217 \fIpathName \fBselection clear \fIfirst \fR?\fIlast\fR? ?\fIcolumn\fR?
1218 Removes the entries between \fIfirst\fR and \fIlast\fR
1219 (inclusive) from the selection.  Both \fIfirst\fR and 
1220 \fIlast\fR are ids representing a range of entries.
1221 If \fIlast\fR isn't given, then only \fIfirst\fR is deselected.
1222 Entries outside the selection are not affected.
1223 .TP
1224 \fIpathName \fBselection clearall\fR
1225 Clears the entire selection.  
1226 .TP
1227 \fIpathName \fBselection mark \fItagOrId\fR ?\fIcolumn\fR?
1228 Sets the selection mark to the node given by \fItagOrId\fR.  This
1229 causes the range of entries between the anchor and the mark to be
1230 temporarily added to the selection.  The selection mark is the end of
1231 the selection that is fixed while dragging out a selection with the
1232 mouse.  The special id \fBmark\fR may be used to refer to the current 
1233 mark node.
1234 If \fItagOrId\fR refers to a non-existent node, then the mark
1235 is ignored.
1236 Resetting the mark will unselect
1237 the previous range.  Setting the anchor finalizes the range.
1238 .TP
1239 \fIpathName \fBselection includes \fItagOrId\fR ?\fIcolumn\fR?
1240 Returns 1 if the node given by \fItagOrId\fR is currently
1241 selected, 0 if it isn't.
1242 .TP
1243 \fIpathName \fBselection present\fR
1244 Returns 1 if any nodes are currently selected and 0 otherwise.
1245 .TP
1246 \fIpathName \fBselection set \fIfirst \fR?\fIlast\fR? ?\fIcolumn\fR?
1247 Selects all of the nodes in the range between
1248 \fIfirst\fR and \fIlast\fR, inclusive, without affecting
1249 the selection state of nodes outside that range.
1250 .TP
1251 \fIpathName \fBselection toggle \fIfirst \fR?\fIlast\fR? ?\fIcolumn\fR?
1252 Selects/deselects nodes in the range between
1253 \fIfirst\fR and \fIlast\fR, inclusive, from the selection.
1254 If a node is currently selected, it becomes deselected, and
1255 visa versa.
1256 .RE
1257 .TP 
1258 \fIpathName \fBshow \fR?\fBflags\fR? \fItagOrId\fR...
1259 Un-hide nodes matching the criteria given by \fIflags\fR.
1260 If no \fItagOrId\fR are given, traverses entire tree.
1261 The \fIflags\fR are the same as for the \fBhide\fR command.
1262 .TP
1263 \fIpathName \fBsort\fR ?\fIoperation\fR? \fIargs...\fR
1264 .RS
1265 .TP
1266 \fIpathName \fBsort auto\fR ?\fIboolean\fR
1267 Turns on/off automatic sorting of node entries.  If \fIboolean\fR is
1268 true, entries will be automatically sorted as they are opened,
1269 closed, inserted, or deleted.  If no \fIboolean\fR argument is
1270 provided, the current state is returned.
1271 .TP
1272 \fIpathName \fBsort cget\fR \fIoption\fR
1273 Returns the current value of the configuration option given
1274 by \fIoption\fR.
1275 \fIOption\fR may have any of the values accepted by the \fBconfigure\fR
1276 operation described below.
1277 .TP
1278 \fIpathName \fBsort configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
1279 Query or modify the sorting configuration options of the widget.
1280 If no \fIoption\fR is specified, returns a list describing all of
1281 the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
1282 information on the format of this list).  If \fIoption\fR is specified
1283 with no \fIvalue\fR, then the command returns a list describing the
1284 one named option (this list will be identical to the corresponding
1285 sublist of the value returned if no \fIoption\fR is specified).  If
1286 one or more \fIoption\-value\fR pairs are specified, then the command
1287 modifies the given sorting option(s) to have the given value(s);  in
1288 this case the command returns an empty string.
1289 \fIOption\fR and \fIvalue\fR are described below:
1290 .RS
1291 .TP
1292 \fB\-column\fI string\fR
1293 Specifies the column to sort. Entries in the widget are rearranged
1294 according to this column.  If \fIcolumn\fR is \fB""\fR then
1295 no sort is performed.
1296 .TP
1297 \fB\-command\fI string\fR
1298 Specifies a Tcl procedure to be called when sorting nodes. 
1299 The procedure is called with 6 arguments: the pathname of the widget,
1300 the node id of two entries, the column key being sorted
1301 and the label values of the two entries.  The procedure returns 1 if the first
1302 node is greater than the second, -1 is the second is greater, and 0
1303 if equal.  
1304 .TP
1305 \fB\-decreasing\fI boolean\fR
1306 Indicates to sort in ascending/descending order.  If \fIboolean\fR 
1307 is true, then the entries as in descending order. The default is 
1308 \fBno\fR.
1309 .TP
1310 \fB\-mode\fI string\fR
1311 Specifies how to compare entries when sorting. \fIString\fR
1312 may be one of the following:
1313 .TP
1314 \fB\-setflat\fI bool\fR
1315 Used by SortColumn to remember if tree was forced to flat by a sort.
1316 .RS 
1317 .TP 1.5i
1318 \fBascii\fR
1319 Use string comparison based upon the ASCII collation order.
1320 .TP 1.5i
1321 \fBdictionary\fR 
1322 Use dictionary-style comparison.  This is the same as \fBascii\fR
1323 except (a) case is ignored except as a tie-breaker and (b) if two
1324 strings contain embedded numbers, the numbers compare as integers, not
1325 characters.  For example, "bigBoy" sorts between
1326 "bigbang" and "bigboy", and "x10y" sorts between "x9y" and "x11y".
1327 .TP 1.5i
1328 \fBinteger\fR
1329 Compares fields as integers.
1330 .TP 1.5i
1331 \fBreal\fR
1332 Compares fields as floating point numbers.
1333 .TP 1.5i
1334 \fBcommand\fR
1335 Use the Tcl proc specified by the \fB\-command\fR option to compare entries 
1336 when sorting.   If no command is specified, the sort reverts to 
1337 \fBdictionary\fR sorting.
1338 .RE
1339 .RE
1340 .TP
1341 \fIpathName \fBsort once\fR ?\fIflags\fR? \fItagOrId...\fR
1342 Sorts the children for each entries specified by \fItagOrId\fR.  
1343 By default, entries are sorted by name, but you can specify a 
1344 Tcl proc to do your own comparisons.
1345 .RS
1346 .TP 1.5i
1347 \fB\-recurse\fR
1348 Recursively sort the entire branch, not just the children.
1349 .RE
1350 .RE
1351 .TP
1352 \fIpathName \fBstyle \fIoperation\fR ?\fIargs\fR?
1353 Styles control how data is to be rendered by the widget.
1354 They are created with the \fBcreate\fR subcommands (described below)
1355 A default style name \fBtext\fR is builtin.  It is of type
1356 \fItextbox\fR and is used as the default style for columns.
1357 Styles may also be applied to entries, individual cells or
1358 widget options.  For example, the \fB-altstyle\fR option applies a style to
1359 every second visible row entry while the
1360 \fB-levelstyles\fR option can specify a different style for each node level.
1361 .sp
1362 The following operations are available for treeview styles.
1363 .RS
1364 .TP
1365 \fIpathName \fBstyle activate\fR ?\fIentry\fR? ?\fIcolumn\fR?
1366 Get or sets a particular cell as state to active.
1367 With two arguments sets the current cell to active. With no arguments
1368 returns the active cell.   With one argument whose entry is 0, sets no
1369 cell to active.
1370 .TP
1371 \fIpathName \fBstyle cget\fR \fIstylename option\fR
1372 Returns the current value of the configuration option given
1373 by \fIoption\fR.
1374 \fIOption\fR may have any of the values accepted by the \fBconfigure\fR
1375 operation described below.
1376 .TP
1377 \fIpathName \fBstyle configure\fR ?\fIstylename option\fR? ?\fIvalue option value ...\fR?
1378 Query or modify the configuration options of the widget.
1379 If no \fIoption\fR is specified, returns a list describing all of
1380 the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
1381 information on the format of this list).  If \fIoption\fR is specified
1382 with no \fIvalue\fR, then the command returns a list describing the
1383 one named option (this list will be identical to the corresponding
1384 sublist of the value returned if no \fIoption\fR is specified).  If
1385 one or more \fIoption\-value\fR pairs are specified, then the command
1386 modifies the given widget option(s) to have the given value(s);  in
1387 this case the command returns an empty string.
1388 \fIOption\fR and \fIvalue\fR are described below:
1389 .TP
1390 \fIpathName \fBstyle create\fR \fI...\fR?
1391 Create a named style.
1392 For a full list of style options, see the section
1393 \fISTYLE OPTIONS\fR below.
1394 .RS
1395 .TP
1396 \fIpathName \fBstyle create barbox\fR \fIstylename\fR ?\fIoption value option value ...\fR?
1397 A \fBbarbox\fR displays numeric data plus a progressbar.
1398 .TP
1399 \fIpathName \fBstyle create checkbox\fR \fIstylename\fR ?\fIoption value option value ...\fR?
1400 A \fBcheckbox\fR style displays boolean or 2-valued data.
1401 .TP
1402 \fIpathName \fBstyle create combobox\fR \fIstylename\fR ?\fIoption value option value ...\fR?
1403 A \fBcombobox\fR style displays multi-valued data.
1404 .TP
1405 \fIpathName \fBstyle create textbox\fR \fIstylename\fR ?\fIoption value option value ...\fR?
1406 A \fBtextbox\fR style displays general text data.
1407 .TP
1408 \fIpathName \fBstyle create windowbox\fR ?\fIstylename\fR? ?\fIoption value option value ...\fR?
1409 The special style \fBwindowbox\fR suports embedding subwindows within data
1410 cells.
1411 .RE
1412 .TP
1413 \fIpathName \fBstyle find\fR \fIstylename ?column? ?node? ...\fR
1414 Get all entries with the given style for a given column in the given nodes.
1415 When no column is given, looks in entry and data columns.
1416 Duplicates are not eliminated.
1417 cell.
1418 .TP
1419 \fIpathName \fBstyle forget\fR \fIstylename ...\fR
1420 Eliminates one or more style names
1421 whose reference count have reached zero (i.e. nothing is using it).
1422 Requests to delete styles that are still in use are quietly ignored.
1423 Note that the reference count of style \fBtext\fR is always greater than zero.
1424 .TP
1425 \fIpathName \fBstyle get\fR \fIcolumn tagorid\fR
1426 Return the style(s) for column and nodes.
1427 cell.
1428 .TP
1429 \fIpathName \fBstyle highlight\fR \fIstylename ?on|off?\fR
1430 Turns on/off highlighting for a particular style.  Used primarily for
1431 columns.
1432 .TP
1433 \fIpathName \fBstyle names\fR
1434 Lists the names of all the current styles in the treeview widget.
1435 %.TP
1436 %\fIpathName \fBstyle priority\fR \fIcolumn node\fR
1437 %Get the priority style for the given cell.
1438 .TP
1439 \fIpathName \fBstyle set\fR \fIstylename column node ...\fR
1440 Sets a style for a given column for all the ids given.
1441 If column is the tree, sets the entry style,
1442 otherwise sets the style in the data column,
1443 thus setting the style for a single
1444 cell in an entry.  The style name may be an empty string to unset the style.
1445 Cells that do not have a value may not have a style set and so are
1446 silently ignored.
1447 The number of cells that actually get set with a style is
1448 returned.
1449 .TP
1450 \fIpathName \fBstyle slaves\fR ?\fB-col \fIcol\fR? ?\fB-id \fInode\fR? ?\fB-style \fIstyleName\fR? ?\fB-visible \fIbool\fR? ?\fB-info \fIpath\fR?
1451 With no arguments, lists all embedded window slaves.
1452 The \fI-col\fR argument shows only windows in the given column.
1453 The \fI-id\fR argument shows only windows for the given entry.
1454 The \fI-style\fR argument shows only windows with the given style.
1455 The \fI-visible\fR argument shows only windows that are visible or invisible.
1456 The \fI-info\fR argument dumps all information for a single window.
1457 .TP
1458 \fIpathName \fBstyle type\fR ?\fIname\fR? ?\fInewtype\fR?
1459 With no arguments, return list of all available styles.
1460 With one argument, return the style type of \fIname\fR. 
1461 With two arguments, change the style type of \fIname\fR to \fInewtype\fR,
1462 and reset all style options back to the defaults.
1463 .TP
1464 \fIpathName \fBstyle use\fR \fIstylename\fR
1465 Return the use count for a style.
1466 Note: in order to remove a style with \fBstyle forget\fR,
1467 this count must be \fB0\fR.
1468 .RE
1469 .TP
1470 \fIpathName \fBtag \fIoperation args\fR
1471 Tags are a general means of selecting and marking nodes in the tree.
1472 A tag is just a string of characters, and it may take any form except
1473 that of an integer.  The same tag may be associated with many
1474 different nodes.  
1475 .sp
1476 Both \fIoperation\fR and its arguments determine the exact behavior of
1477 the command.  The operations available for tags are listed below.
1478 .RS
1479 .TP
1480 \fIpathName\fR \fBtag add\fR \fIstring\fR ?\fIid\fR...?
1481 Adds the tag \fIstring\fR to one of more entries.
1482 If no nodes are given, just creates the tag.
1483 .TP
1484 \fIpathName\fR \fBtag delete\fR \fIstring\fR \fItagnode\fR...
1485 Deletes the tag \fIstring\fR from one or more entries.  
1486 .TP
1487 \fItreeName\fR \fBtag exists\fR \fIstring\fR ?\fIid\fR?
1488 If an \fIid\fR is given, return 1 (or 0)  if entry has (or hasn't) the tag.
1489 Otherwise, returns 1 if at least one entry has tag \fIstring\fR.
1490 .TP
1491 \fIpathName\fR \fBtag forget\fR \fIstring\fR
1492 Removes the tag \fIstring\fR from all entries.  It's not an error if no
1493 entries are tagged as \fIstring\fR.
1494 .TP
1495 \fIpathName\fR \fBtag names\fR ?\fIid\fR?
1496 Returns a list of tags used.  If an \fIid\fR argument
1497 is present, only those tags used by the node designated by \fIid\fR 
1498 are returned.
1499 .TP
1500 \fIpathName\fR \fBtag nodes\fR  \fIname\fR ?\fIname\fR ...?
1501 Returns a list of ids that have any of the \fIname\fR tags.  If no node
1502 is tagged as \fIname\fR, then an empty list is returned.
1503 .RE
1504 .TP
1505 \fIpathName \fBtoggle \fItagnode\fR
1506 Opens or closes the node given by \fItagOrId\fR.  If the corresponding 
1507 \fB\-opencommand\fR or \fB\-closecommand\fR option is set, then that
1508 command is also invoked. 
1509 .TP
1510 \fIpathName \fBxview \fIargs\fR
1511 This command is used to query and change the horizontal position of the
1512 information in the widget's window.  It can take any of the following
1513 forms:
1514 .RS
1515 .TP
1516 \fIpathName \fBxview\fR
1517 Returns a list containing two elements.
1518 Each element is a real fraction between 0 and 1;  together they describe
1519 the horizontal span that is visible in the window.
1520 For example, if the first element is .2 and the second element is .6,
1521 20% of the \fBtreeview\fR widget's text is off-screen to the left, 
1522 the middle 40% is visible
1523 in the window, and 40% of the text is off-screen to the right.
1524 These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
1525 option.
1526 .TP
1527 \fIpathName \fBxview\fR \fItagOrId\fR
1528 Adjusts the view in the window so that the character position given by
1529 \fItagOrId\fR is displayed at the left edge of the window.
1530 Character positions are defined by the width of the character \fB0\fR.
1531 .TP
1532 \fIpathName \fBxview moveto\fI fraction\fR
1533 Adjusts the view in the window so that \fIfraction\fR of the
1534 total width of the \fBtreeview\fR widget's text is off-screen to the left.
1535 \fIfraction\fR must be a fraction between 0 and 1.
1536 .TP
1537 \fIpathName \fBxview scroll \fInumber what\fR
1538 This command shifts the view in the window left or right according to
1539 \fInumber\fR and \fIwhat\fR.
1540 \fINumber\fR must be an integer.
1541 \fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation
1542 of one of these.
1543 If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
1544 \fInumber\fR character units (the width of the \fB0\fR character)
1545 on the display;  if it is \fBpages\fR then the view adjusts by
1546 \fInumber\fR screenfuls.
1547 If \fInumber\fR is negative then characters farther to the left
1548 become visible;  if it is positive then characters farther to the right
1549 become visible.
1550 .RE
1551 .TP
1552 \fIpathName \fByview \fI?args\fR?
1553 This command is used to query and change the vertical position of the
1554 text in the widget's window.
1555 It can take any of the following forms:
1556 .RS
1557 .TP
1558 \fIpathName \fByview\fR
1559 Returns a list containing two elements, both of which are real fractions
1560 between 0 and 1.
1561 The first element gives the position of the node at the
1562 top of the window, relative to the widget as a whole (0.5 means
1563 it is halfway through the treeview window, for example).
1564 The second element gives the position of the node just after
1565 the last one in the window, relative to the widget as a whole.
1566 These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR
1567 option.
1568 .TP
1569 \fIpathName \fByview\fR \fItagOrId\fR
1570 Adjusts the view in the window so that the node given by
1571 \fItagOrId\fR is displayed at the top of the window.
1572 .TP
1573 \fIpathName \fByview moveto\fI fraction\fR
1574 Adjusts the view in the window so that the node given by \fIfraction\fR
1575 appears at the top of the window.
1576 \fIFraction\fR is a fraction between 0 and 1;  0 indicates the first
1577 node, 0.33 indicates the node one-third the
1578 way through the \fBtreeview\fR widget, and so on.
1579 .TP
1580 \fIpathName \fByview scroll \fInumber what\fR
1581 This command adjusts the view in the window up or down according to
1582 \fInumber\fR and \fIwhat\fR.
1583 \fINumber\fR must be an integer.
1584 \fIWhat\fR must be either \fBunits\fR or \fBpages\fR.
1585 If \fIwhat\fR is \fBunits\fR, the view adjusts up or down by
1586 \fInumber\fR lines;  if it is \fBpages\fR then
1587 the view adjusts by \fInumber\fR screenfuls.
1588 If \fInumber\fR is negative then earlier nodes
1589 become visible;  if it is positive then later nodes
1590 become visible.
1591 .RE
1592 .SH TREEVIEW EDITING
1593 A column of data is editable when  its \fB-edit\fR option is set to True
1594 For column 0, edit changes an entries \fI-label\fR option.
1595 For all other columns, edit will update the \fI-data\fR fields.
1596 Tree data traces can also be used for edit control.
1597 Most of the following applies to textbox styles.
1598 However, combobox and checkbox also generate <<TreeViewEditStart/End>> events
1599 while barbox and windowbox are not editable.
1600 .PP
1601 Text editing is aborted with <Escape> and finished with <Return>.
1602 A newline may be inserted with a <Control-r>.
1603 Native Tk widgets are now used for builtin editing, using the
1604 path \fB$w.edit\fR.
1605 By default an \fBentry\fR widget will be used,  however, column editing options
1606 can be changed via \fB-editopts\fR
1607 and \fB-validatecmd\fR. Moreover, columns with a combobox style
1608 can provide popup list of options in a listbox
1609 using the following style options: \fB-choices, -choicecmd, -choicekey, -choiceicons\fR
1610 Two virtual events can be used to gain control the during edit:
1611 \fI<<TreeViewEditStart>>\fR and \fI<<TreeViewEditEnd>>\fR.
1612 The column index is passed in %x, and the entry-row index is passed in %y.
1613 eg.
1614 .CS
1615 treeview .t
1616 bind .t <<TreeViewEditStart>> {EditStart %W %x %y}
1617 bind .t <<TreeViewEditEnd>> {EditEnd %W %x %y}
1618 .CE
1619 These gain control at the start and end of editing respectively,
1620 and are general alternatives to \fI-editopts\fR -startcmd and -endcmd.
1621 For further details see \fIblt::tv::EditCell\fR in
1622 \fB$blt_library/treeview.tcl\fR.
1623 .SH "TREEVIEW OPTIONS"
1624 In addition to the \fBconfigure\fR operation, widget configuration
1625 options may also be set by the Tk \fBoption\fR command.  The class
1626 resource name is \fBTreeView\fR.
1627 .CS
1628 option add *TreeView.Foreground white
1629 option add *TreeView.Background blue
1630 .CE
1631 The following widget options are available:
1632 .TP
1633 \fB\-activeicons \fIimages\fR
1634 Specifies images to be displayed for an entry's icon
1635 when it is active. \fIImages\fR is a list of two Tk images: 
1636 the first image is displayed when the node is open, the
1637 second when it is closed.
1638 .TP
1639 \fB\-activeleaficons \fIimages\fR
1640 Specifies images to be displayed for an leaf entry's icon
1641 when it is active. \fIImages\fR is a list of two Tk images: 
1642 the first image is displayed when the node is open, the
1643 second when it is closed.
1644 .TP
1645 \fB\-allowduplicates \fIboolean\fR
1646 If \fIboolean\fR is true, allow nodes with duplicate pathnames
1647 when inserting new nodes.  Otherwise flag an error.
1648 The default is \fBno\fR.
1649 .TP
1650 \fB\-altstyle \fIstylename\fR
1651 Set a style to use on every other row.  This provides a simple way
1652 to implement alternating row colors without explicitly
1653 setting entry options.  Note \fB-altstyle\fR has limitations.
1654 Mostly it is used for setting the background, foreground and tile.
1655 Currently the font will not be used in height sizing, and the icon is ignored.
1656 .TP
1657 \fB\-autocreate \fIboolean\fR
1658 If \fIboolean\fR is true, automatically create missing ancestor 
1659 nodes when inserting new nodes. Otherwise flag an error.
1660 The default is \fBno\fR.
1661 .TP
1662 \fB\-background \fIcolor\fR
1663 Sets the background color of the widget.  The default is \fBwhite\fR.
1664 .TP
1665 \fB\-borderwidth \fIpixels\fR
1666 Sets the width of the 3\-D border around the outside edge of the widget.  The
1667 \fB\-relief\fR option determines if the border is to be drawn.  The
1668 default is \fB2\fR.
1669 .TP
1670 \fB\-button \fIstring\fR
1671 Indicates whether a entries should display button.
1672 If set to anything other than the default of \fIauto\fR, buttons
1673 will not be displayed.
1674 .TP
1675 \fB\-closecommand \fIstring\fR
1676 Specifies a Tcl script to be invoked when a node is closed.  You can
1677 overrider this for individual entries using the entry's \fB\-closecommand\fR 
1678 option. The default is \fB""\fR.
1679 Percent substitutions are performed on \fIstring\fR before 
1680 it is executed.  The following substitutions are valid:
1681 .RS 
1682 .TP 5
1683 \fB%W\fR
1684 The pathname of the widget.
1685 .TP 5
1686 \fB%p\fR
1687 The name of the node.
1688 .TP 5
1689 \fB%P\fR
1690 The full pathname of the node.
1691 .TP 5
1692 \fB%#\fR
1693 The id of the node.
1694 .TP 5
1695 \fB%%\fR
1696 Translates to a single percent.
1697 .RE
1698 .TP
1699 \fB\-columnshowhighlight \fIbool\fR
1700 Enable display highlight color when column activated.
1701 Default is false.
1702 .TP
1703 \fB\-cursor \fIcursor\fR
1704 Specifies the widget's cursor.  The default cursor is \fB""\fR.
1705 .TP
1706 \fB\-dashes \fInumber\fR
1707 Sets the dash style of the horizontal and vertical lines drawn connecting 
1708 entries. \fINumber\fR is the length in pixels of the dashes and gaps in
1709 the line. If \fInumber\fR is \fB0\fR, solid lines will 
1710 be drawn. The default is \fB1\fR (dotted).
1711 .TP
1712 \fB\-emptystyle \fIstylename\fR
1713 Set a style to be used for empty cells.
1714 .TP
1715 \fB\-entryshowhighlight \fIbool\fR
1716 Enable display highlight color when entry activated.
1717 Default is false.
1718 .TP
1719 \fB\-exportselection \fIboolean\fR 
1720 Indicates if the selection is exported.  If the widget is exporting its
1721 selection then it will observe the standard X11 protocols for handling
1722 the selection.  Selections are available as type \fBSTRING\fR;
1723 the value of the selection will be the label of the selected nodes,
1724 separated by newlines.  The default is \fBno\fR.
1725 .TP
1726 \fB\-fillnull \fIboolean\fR 
1727 Indicates that empty data columns are to be drawn anyways,
1728 and to apply the \fI-nullstyle\fR if defined.
1729 Turning this off will leave unsightly gaps where attributes (eg. background
1730 and underline) were normally expected to be displayed.
1731 The default is \fByes\fR.
1732 .TP
1733 \fB\-flat \fIboolean\fR
1734 Indicates whether to display the tree as a flattened list. 
1735 If \fIboolean\fR is true, then the hierarchy will be a list of full
1736 paths for the nodes.  Hide and show are not supported in flat mode.
1737 This option also has affect on sorting. 
1738 See the 
1739 .SB "sort command"
1740 for more information.
1741 The default is \fBno\fR.
1742 .TP
1743 \fB\-focusdashes \fIdashList\fR 
1744 Sets the dash style of the outline rectangle drawn around the entry
1745 label of the node that current has focus. \fINumber\fR is the length
1746 in pixels of the dashes and gaps in the line.  If
1747 \fInumber\fR is \fB0\fR, a solid line will be drawn. The default is
1748 \fB1\fR.
1749 .TP
1750 \fB\-focusforeground \fIcolor\fR 
1751 Sets the color of the focus rectangle. 
1752 The default is \fBblack\fR.
1753 .TP
1754 \fB\-focusheight \fIvalue\fR 
1755 Set the height in pixels to reserve for focus highlighting above
1756 and below the line.
1757 The default is \fB1\fR, but setting this to 0 will result in a
1758 more compact display.
1759 .TP
1760 \fB\-font \fIfontName\fR 
1761 Specifies the font to use for text.  The default is \fBTkDefaultFont\fR.
1762 .TP
1763 \fB\-foreground \fIcolor\fR 
1764 Sets the text color of entry labels.  You can override this for individual
1765 entries with the entry's \fB\-foreground\fR configuration option.  
1766 The default is
1767 \fBblack\fR.
1768 .TP
1769 \fB\-height \fIpixels\fR
1770 Specifies the requested height of widget.  The default is
1771 \fB400\fR.
1772 .TP
1773 \fB\-formatcmd \fIscriptcmd\fR 
1774 Command called to format the displayed data value.
1775 Percent substitutions are performed on \fIscriptcmd\fR as per \fIfind -exec\fR.
1776 The called command returns the value to be displayed.
1777 This may be overridden by column or style \fB-formatcmd\fR.
1778 For the tree column, has no effect when using -showfull with -flat.
1779 .TP
1780 \fB\-hidedataicons \fIboolean\fR
1781 If \fIboolean\fR is true, it indicates that data column icons
1782 (set via styles)
1783 should not be displayed.  The default is \fBno\fR.
1784 .TP
1785 \fB\-hidedatatext \fIboolean\fR
1786 If \fIboolean\fR is true, it indicates that that data column text
1787 should not be displayed.  The default is \fBno\fR.
1788 .TP
1789 \fB\-hideicons \fIboolean\fR
1790 If \fIboolean\fR is true, it indicates that tree column icons
1791 should not be displayed.  The default is \fBno\fR.
1792 .TP
1793 \fB\-hideleaves \fIboolean\fR
1794 If \fIboolean\fR is true, it indicates that no leaves
1795 should be displayed.  The default is \fBno\fR.
1796 .TP
1797 \fB\-hideroot \fIboolean\fR
1798 If \fIboolean\fR is true, it indicates that no entry for the root node 
1799 should be displayed.  The default is \fBno\fR.
1800 .TP 
1801 \fB\-highlightbackground  \fIcolor\fR
1802 Specifies the normal color of the traversal highlight region when
1803 the widget does not have the input focus.  
1804 .TP 
1805 \fB\-highlightcolor \fIcolor\fR
1806 Specifies the color of the traversal highlight rectangle when
1807 the widget has the input focus. 
1808 The default is \fBblack\fR.
1809 .TP 
1810 \fB\-highlightthickness \fIpixels\fR
1811 Specifies the width of the highlight rectangle indicating when the
1812 widget has input focus. The value may have any of the forms acceptable
1813 to \fBTk_GetPixels\fR.  If the value is zero, no focus highlight will
1814 be displayed.  The default is \fB2\fR.
1815 .TP
1816 \fB\-icons \fIimages\fR
1817 Specifies images for the entry's icon.
1818 \fIImages\fR is a list of two Tk images: 
1819 the first image is displayed when the node is open, the
1820 second when it is closed.
1821 .TP
1822 \fB\-imagecmd \fIscriptcmd\fR
1823 Specifies a command to call the first time an image is displayed
1824 for any image used in the \fB-images\fR, \fB-*icon\fR,
1825 and \fB-*icons\fR options.
1826 Percent substitutions is performed on \fIscriptcmd\fR as per \fIfind -exec\fR,
1827 with the image name being used as the value (%V).
1828 The called command can either modify the image or set a new icon.
1829 .sp
1830 The main use of \fB-imagecmd\fR is to perform image loading on demand
1831 as they become visible for the first time.  To use it,
1832 an icon option must be set with a placeholder image.
1833 When this becomes visible the first time,
1834 the callback will replaces it with a real image.
1835 The callback may also add tags, styles or even dynamically load data, eg.
1836 .CS
1837
1838   proc ICMD {w id col img} {
1839     $w entry conf $id -icon blt::tv::normalFile
1840     #$img conf -file [GetFile $id $col]
1841     $w tag add addimg $id
1842   }
1843
1844   pack [treeview .t -imagecmd {ICMD %W %# %C %V}]
1845   foreach i {A B C} {
1846     .t insert end  $i -icons [image create photo]
1847   }
1848 .CE
1849 .TP
1850 \fB\-inlinedata \fIbool\fR
1851 Enables that data column values that start with a \fB@\fR and are
1852 a list of length 2, are to be interpreted as
1853 an inline style or image name.
1854 If value is the name of an image, a style is created
1855 using the name of image with -icon set to that image.
1856 A style is applied to the cell in the manner of \fBstyle set\fR.
1857 Default is \fItrue\fR.
1858 .TP
1859 \fB\-insertfirst\fInum\fR
1860 Upon inserts use forward search of tree label for num elements,
1861 then fall back to a reverse search. The default is 1,
1862 which provides for very fast insertions
1863 at the begining or near the end of really long trees.
1864 Set to -1 for forward search only, for example, if using \fI-allowduplicates\fR.
1865 .TP
1866 \fB\-leaficons \fIimages\fR
1867 Specifies images for a leaf entry's icons.
1868 \fIImages\fR is a list of two Tk images: 
1869 the first image is displayed when the node is open, the
1870 second when it is closed.
1871 .TP
1872 \fB\-levelpad \fIpixels\fR
1873 Indentation to add when displaying sub-tree levels.
1874 .TP
1875 \fB\-levelstyles \fIstylenames\fR
1876 Set a list of styles to use for entries at a given level.
1877 The first style is used for entries at level 1, the second for level 2, etc.
1878 This provides a simple way
1879 to specify colors for entries at a given level without explicitly
1880 setting entry options.
1881 .TP
1882 \fB\-linecolor \fIcolor\fR
1883 Sets the color of the connecting lines drawn between entries.  
1884 The default is \fBblack\fR.
1885 .TP
1886 \fB\-linespacing \fIpixels\fR
1887 Sets the number of pixels spacing between entries.  
1888 The default is \fB0\fR.
1889 .TP
1890 \fB\-linewidth \fIpixels\fR
1891 Set the width of the lines drawn connecting entries.  If \fIpixels\fR
1892 is \fB0\fR, no vertical or horizontal lines are drawn. 
1893 The default is \fB1\fR.
1894 .TP
1895 \fB\-minheight \fIpixels\fR
1896 Set the minimum height for entries.  Default is \fI0\fR.
1897 .TP
1898 \fB\-nextauto\fInum\fR
1899 For inserts at the root node, the start number for the next #auto insert.
1900 This is automatically incremented at each insert which
1901 speeds up bulk #auto inserts.
1902 .TP
1903 \fB\-nextsubauto\fInum\fR
1904 For inserts not into the root node, the number
1905 the next child #auto insert starts it's search from.
1906 The default is \fB1\fR.
1907 .TP
1908 \fB\-newtags \fIboolean\fR 
1909 If \fIboolean\fR is true, when sharing a tree object (see the
1910 \fB\-tree\fR option), don't share its tags too.  
1911 The default is \fB0\fR.
1912 .TP
1913 \fB\-noautocloseleaf \fIboolean\fR
1914 If \fIboolean\fR is true, then opening a leaf node will leave it in
1915 open mode.  The default is \fBfalse\fR, which automatically sets the
1916 mode of a leaf node back to closed without invoking \fB-closecommand\fR.
1917 .TP
1918 \fB\-nofocusselectbackground \fIcolor\fR
1919 Background select color when focus lost.
1920 .TP
1921 \fB\-nofocusselectforeground \fIcolor\fR
1922 Foreground select color when focus lost.
1923 .TP
1924 \fB\-openanchor \fIstring\fR
1925 When a node with children is opened, defines the -anchor used
1926 to the see sub-command.  Must be one of: \fBn c s\fR.
1927 The default is \fBc\fR.
1928 .TP
1929 \fB\-opencommand \fIstring\fR
1930 Specifies a Tcl script to be invoked when a node is open.  
1931 You can override this for individual entries with the entry's
1932 \fB\-opencommand\fR configuration option.  The default is \fB""\fR.
1933 Percent substitutions are performed on \fIstring\fR before 
1934 it is executed.  The following substitutions are valid:
1935 .RS 
1936 .TP 5
1937 \fB%W\fR
1938 The pathname of the widget.
1939 .TP 5
1940 \fB%p\fR
1941 The name of the node.
1942 .TP 5
1943 \fB%P\fR
1944 The full pathname of the node.
1945 .TP 5
1946 \fB%#\fR
1947 The id of the node.
1948 .TP 5
1949 \fB%%\fR
1950 Translates to a single percent.
1951 .RE
1952 .TP
1953 \fB\-padx \fIpixels\fR
1954 Set the padding on left and right of widget.
1955 .TP
1956 \fB\-pady \fIpixels\fR
1957 Set the padding on top and bottom of widget.
1958 .TP
1959 \fB\-relief \fIrelief\fR
1960 Specifies the 3-D effect for the widget.  \fIRelief\fR
1961 specifies how the \fBtreeview\fR widget should appear relative to widget 
1962 it is packed into; for example, \fBraised\fR means the \fBtreeview\fR widget 
1963 should appear to protrude.  The default is \fBsunken\fR.
1964 .TP
1965 \fB\-resizecursor \fIstring\fR
1966 Cursor to use on resize.
1967 .TP
1968 \fB\-rootnode \fInum\fR
1969 Specifiy the node number that is to be the root.
1970 This allows a subtree to appear as the root.
1971 Multiple treeviews may share a tree with different root nodes,
1972 and thus supporting subviews.  Default is 0.
1973 .TP
1974 \fB\-scrollmode \fImode\fR 
1975 Specifies the style of scrolling to be used.
1976 There are three different modes of scrolling: \fBlistbox\fR,
1977 \fBcanvas\fR, and \fBhierbox\fR.  In \fBlistbox\fR mode, the last
1978 entry can always be scrolled to the top of the widget.  In \fBhierbox\fR
1979 mode, the last entry is always drawn at the bottom of the widget.
1980 The default is \fBhierbox\fR.
1981 .RS
1982 .TP 1i
1983 \fBlistbox\fR
1984 Like the \fBlistbox\fR widget, the last entry can always be
1985 scrolled to the top of the widget window.  This allows the scrollbar
1986 thumb to shrink as the last entry is scrolled upward.
1987 .TP 1i
1988 \fBhierbox\fR
1989 Like the \fBhierbox\fR widget, the last entry can only be
1990 viewed at the bottom of the widget window.  The scrollbar
1991 stays a constant size.  
1992 .TP 1i
1993 \fBcanvas\fR
1994 Like the \fBcanvas\fR widget, the entries are bound within
1995 the scrolling area. 
1996 .RE
1997 .TP
1998 \fB\-scrolltile \fIbool\fR 
1999 Specifies if tiling should scroll with widget.
2000 The default is \fBfalse\fR.
2001 .TP 
2002 \fB\-selectbackground \fIcolor\fR
2003 Sets the background color selected node entries.
2004 The default is \fB#ffffea\fR.
2005 .TP 
2006 \fB\-selectborderwidth \fIpixels\fR
2007 Sets the width of the raised 3-D border drawn around the labels 
2008 of selected entries. The default is \fB0\fR.
2009 .TP
2010 \fB\-selectcommand \fIstring\fR
2011 Specifies a Tcl script to invoked when the set of selected
2012 nodes changes.
2013 The default is \fB""\fR.
2014 .TP
2015 \fB\-selectforeground\fR \fIcolor\fB
2016 Sets the color of the labels of selected node entries while the
2017 widget has focus. 
2018 The default is \fBblack\fR.
2019 .TP 
2020 \fB\-selectmode \fImode\fR
2021 Specifies the selection mode. If \fImode\fR is 
2022 \fBsingle\fR, only one node can be selected
2023 at a time.  If \fBmultiple\fR more than one
2024 node can be selected.
2025 If \fBnone\fR no selection is displayed.
2026 If \fIcell\fR or \fImulticell\fR then selection is for cells
2027 rather than whole nodes (rows).
2028 The default is \fBsingle\fR.
2029 .TP
2030 \fB\-selectrelief \fIrelief\fR
2031 Specifies the 3-D effect of the selected text in the edit window.  
2032 \fIRelief\fR indicates how the text should appear relative to the edit
2033 window; for example, \fBraised\fR means the text should
2034 appear to protrude.  The default is \fBflat\fR.
2035 .TP
2036 \fB\-selecttile \fIimage\fR
2037 Set a tile background image to use for selection.
2038 .TP
2039 \fB\-separator \fIstring\fR
2040 Specifies the character sequence to use when spliting the path components.  
2041 The separator may be several characters wide (such as "::")
2042 Consecutive separators in a pathname are treated as one.
2043 If \fIstring\fR is the empty string, the pathnames are Tcl lists. 
2044 If \fIstring\fR is the \fBnone\fR, no splitting will is done.
2045 Each element is a path component.   The default is \fB""\fR.
2046 .TP
2047 \fB\-showfull \fIboolean\fR
2048 Show full path name when in \fB-flat\fR mode.
2049 The default is \fItrue\fR.
2050 .TP
2051 \fB\-showtitles \fIboolean\fR
2052 If \fIboolean\fR is false, column titles are not be displayed.  
2053 The default is \fByes\fR.
2054 .TP 
2055 \fB\-sortselection \fIboolean\fR
2056 If \fIboolean\fR is true, nodes in the selection are ordered as they
2057 are currently displayed (depth-first or sorted), not in the order
2058 they were selected. The default is \fBno\fR.
2059 .TP
2060 \fB\-stylecommand \fIstring\fR
2061 Specifies a Tcl command to handle references to unknown styles.
2062 The call performs the same substitutions as the \fI-exec\fR option in
2063 the \fBfind\fR command, except \fIstring\fR is used for \fB%V\fR.
2064 The called command is expected to create the style.
2065 The default values is \fB"%W style create textbox %V"\fR.
2066 .sp
2067 Dynamic creation is performed for any style used in
2068 the \fBconfigure\fR subcommands.
2069 It also handles inline data of the form 
2070 for the image passed after the @ sign
2071 (see the \fI-inlinedata\fR option).
2072 .TP
2073 \fB\-substyle \fIstylename\fR
2074 Set a style for use with the \fB-sublabel\fR.
2075 Note: you can hide all \fIsublabels\fR by using a style
2076 with the \fB-hide\fR option set.
2077 .TP
2078 \fB\-takefocus\fR \fIfocus\fR 
2079 Provides information used when moving the focus from window to window
2080 via keyboard traversal (e.g., Tab and Shift-Tab).  If \fIfocus\fR is
2081 \fB0\fR, this means that this window should be skipped entirely during
2082 keyboard traversal.  \fB1\fR means that the this window should always
2083 receive the input focus.  An empty value means that the traversal
2084 scripts make the decision whether to focus on the window.
2085 The default is \fB"1"\fR.
2086 .TP
2087 \fB\-tile \fIimage\fR
2088 Set background tile image.
2089 .TP
2090 \fB\-titlefont \fIfont\fR
2091 Font to use for titles.
2092 .TP
2093 \fB\-titlepad \fIN\fR
2094 Pad to add above and below title.
2095 .TP
2096 \fB\-tree \fItree\fR
2097 Use an externally created data \fItree\fR object.
2098 Using a \fBtree\fR command facilitates data access, tracing, and
2099 loading/saving. eg.
2100 .CS
2101   set t [tree create]
2102   set n 0
2103   while {[incr n]<30000} {
2104      $t insert end -data {A 0 B 0}
2105   }
2106   pack [treeview .tv -tree $t]
2107   .tv column insert end A B
2108 .CE
2109 .TP
2110 \fB\-trim \fIstring\fR
2111 Specifies a string leading characters to trim from entry pathnames 
2112 before parsing.  This only makes sense if the \fB\-separator\fR is also
2113 set.  The default is \fB""\fR.
2114 .TP
2115 \fB\-underline \fIheight\fR
2116 Draw an underline of the given height below each entry across its entire width.
2117 Use in conjunction with column reliefs this provides a grid like effect.
2118 The default height is 0.
2119 .TP
2120 \fB\-width \fIpixels\fR
2121 Sets the requested width of the widget.  If \fIpixels\fR is 0, then
2122 the with is computed from the contents of the \fBtreeview\fR widget.
2123 The default is \fB200\fR.
2124 .TP 
2125 \fB\-xscrollcommand \fIstring\fR
2126 Specifies the prefix for a command used to communicate with horizontal
2127 scrollbars.  Whenever the horizontal view in the widget's window 
2128 changes, the widget will generate a Tcl command by concatenating the 
2129 scroll command and two numbers.  If this option is not specified, then 
2130 no command will be executed.
2131 .TP
2132 \fB\-xscrollincrement\fR \fIpixels\fR
2133 Sets the horizontal scrolling distance. The default is 20 pixels.
2134 .TP
2135 \fB\-yscrollcommand \fIstring\fR
2136 Specifies the prefix for a command used to communicate with vertical
2137 scrollbars.   Whenever the vertical view in the widget's window 
2138 changes, the widget will generate a Tcl command by concatenating the 
2139 scroll command and two numbers.  If this option is not specified, then 
2140 no command will be executed.
2141 .TP
2142 \fB\-yscrollincrement\fR \fIpixels\fR
2143 Sets the vertical scrolling distance. The default is 20 pixels.
2144 .SH "ENTRY OPTIONS"
2145 Many widget configuration options have counterparts in entries.  For
2146 example, there is a \fB\-closecommand\fR configuration option for both
2147 widget itself and for individual entries.  Options set at the widget
2148 level are global for all entries.  If the entry configuration option
2149 is set, then it overrides the widget option.  This is done to avoid
2150 wasting memory by replicated options.  Most entries will have
2151 redundant options.
2152 .PP
2153 There is no resource class or name for entries.
2154 .TP
2155 \fB\-activeicons \fIimages\fR
2156 Specifies images to be displayed as the entry's icon
2157 when it is active. This overrides the global \fB\-activeicons\fR
2158 configuration option for the specific entry.
2159 \fIImages\fR is a list of two Tk images: 
2160 the first image is displayed when the node is open, the
2161 second when it is closed.
2162 .TP
2163 \fB\-bindtags \fItagList\fR
2164 Specifies the binding tags for nodes.  \fITagList\fR is a list
2165 of binding tag names.  The tags and their order will determine how
2166 events are handled for nodes.  Each tag in the list matching the current 
2167 event sequence will have its Tcl command executed.  The default value 
2168 is \fBall\fR.
2169 .TP
2170 \fB\-button \fIstring\fR
2171 Indicates whether a button should be displayed on the left side
2172 of the node entry.  \fIString\fR can be \fByes\fR, \fBno\fR, 
2173 or \fBauto\fR.  If \fBauto\fR, then a button is automatically
2174 displayed if the node has children.  This is the default.
2175 .TP
2176 \fB\-closecommand \fIstring\fR
2177 Specifies a Tcl script to be invoked when the node is closed.  This
2178 overrides the global \fB\-closecommand\fR option for this entry.
2179 The default is \fB""\fR.
2180 Percent substitutions are performed on \fIstring\fR before 
2181 it is executed.  The following substitutions are valid:
2182 .RS 
2183 .TP 5
2184 \fB%W\fR
2185 The pathname of the widget.
2186 .TP 5
2187 \fB%p\fR
2188 The name of the node.
2189 .TP 5
2190 \fB%P\fR
2191 The full pathname of the node.
2192 .TP 5
2193 \fB%#\fR
2194 The id of the node.
2195 .TP 5
2196 \fB%%\fR
2197 Translates to a single percent.
2198 .RE
2199 .TP
2200 \fB\-data \fIlist\fR
2201 Initializes or change data fields for the node.  \fIList\fR is a list of 
2202 name-value pairs to be set.  Note, this can not be used to unset or
2203 forget values for columns, meaning an empty list does nothing.
2204 For unsetting use \fBentry unset\fR.
2205 The default is \fB""\fR.
2206 .TP
2207 \fB\-font \fIfontName\fR 
2208 Sets the font for entry row text.  This overrides the widget's
2209 \fB\-font\fR option for this node.
2210 .TP
2211 \fB\-forcetree \fIbool\fR
2212 Force node to be treated as a tree, even if it has no children.
2213 This differs from \fI-button\fR above in that all drawing
2214 and querying aspects of the node are treated as a tree.
2215 This option is useful primarily for deferring loading until a tree is opened.
2216 The default is \fBfalse\fR.
2217 .TP
2218 \fB\-foreground \fIcolor\fR 
2219 Sets the text color of the entry label.  This overrides the widget's
2220 \fB\-foreground\fR configuration option.  The default is \fB""\fR.
2221 .TP
2222 \fB\-height \fInum\fR
2223 Set height for entry.
2224 .TP
2225 \fB\-hide \fIbool\fR
2226 Hide the entry.
2227 .TP
2228 \fB\-icons \fIimages\fR
2229 Specifies images to be displayed for the entry's icon.
2230 This overrides the global \fB\-icons\fR configuration option.
2231 \fIImages\fR is a list of two Tk images: 
2232 the first image is displayed when the node is open, the
2233 second when it is closed.
2234 .TP
2235 \fB-isopen\fR \fIbool\fR
2236 Specify if the entries is in the open state.
2237 The default is \fBfalse\fR.
2238 .TP
2239 \fB\-label \fIstring\fR
2240 Sets the text for the entry's displayed label.
2241 If set to  \fB""\fR, the label of the tree node is displayed
2242 The default is \fB""\fR  (see \fBentry relabel\fR).
2243 .TP
2244 \fB\-opencommand \fIstring\fR
2245 Specifies a Tcl script to be invoked when the entry is opened.  
2246 This overrides the widget's \fB\-opencommand\fR option for this node.  
2247 The default is \fB""\fR. 
2248 Percent substitutions are performed on \fIstring\fR before 
2249 it is executed.  The following substitutions are valid:
2250 .RS 
2251 .TP 5
2252 \fB%W\fR
2253 The pathname of the widget.
2254 .TP 5
2255 \fB%p\fR
2256 The name of the node.
2257 .TP 5
2258 \fB%P\fR
2259 The full pathname of the node.
2260 .TP 5
2261 \fB%#\fR
2262 The id of the node.
2263 .TP 5
2264 \fB%%\fR
2265 Translates to a single percent.
2266 .RE
2267 .TP
2268 \fB\-shadow \fIcolor\fR 
2269 Set shadow color for text.
2270 .TP
2271 \fB\-state \fIvalue\fR
2272 Set the state of the entry where \fIvalue\fR is one of:
2273 \fBnormal\fR, \fBactive\fR, \fBdisabled\fR.
2274 The default state is \fBnormal\fR.
2275 When the state is set to \fBdisabled\fR, the text color
2276 displays using \fB-disabledforeground\fR and the
2277 node ignores any attempted \fBopen\fR or \fBclose\fR.
2278 .TP
2279 \fB\-style \fIstylename\fR
2280 Set the style to use for the entry. This will override the column
2281 style, just as \fIstyle set\fR will override an entry style.
2282 This is useful mostly for seting bg/fg/font
2283 for a row.  Other options may or may not do nothing.
2284 Note, setting icon in a style will apply to all value
2285 columns, but not the tree column.
2286 .TP
2287 \fB\-sublabel \fIstring\fR
2288 Sets the text for the entry's sub-label to be displayed to the right
2289 of the nodes \fB-label\fR value.  This is rendered using the
2290 \fB-substyle\fR style.
2291 .TP
2292 \fB\-underline \fInum\fR
2293 Character to underline in an entries text label.  Default is -1.
2294 .TP
2295 \fB\-userdata \fIlist\fR
2296 Extra space available for storing user data.
2297 .SH "BUTTON OPTIONS"
2298 Button configuration options may also be set by the \fBoption\fR command.
2299 The resource subclass is \fBButton\fR.   The resource name is always
2300 \fBbutton\fR.
2301 .CS
2302 option add *TreeView.Button.Foreground white
2303 option add *TreeView.button.Background blue
2304 .CE
2305 The following are the configuration options available for buttons.
2306 .TP
2307 \fB\-activebackground \fIcolor\fR
2308 Sets the background color of active buttons.  A button
2309 is made active when the mouse passes over it or by the 
2310 \fBbutton activate\fR operation.  
2311 .TP
2312 \fB\-activeforeground \fIcolor\fR
2313 Sets the foreground color of active buttons.  A button
2314 is made active when the mouse passes over it or by the 
2315 \fBbutton activate\fR operation.  
2316 .TP
2317 \fB\-activeimages \fIimages\fR
2318 Specify images to use for active buttons.
2319 .TP
2320 \fB\-background \fIcolor\fR
2321 Sets the background of the button.  The default is \fBwhite\fR.
2322 .TP
2323 \fB\-borderwidth \fIpixels\fR
2324 Sets the width of the 3\-D border around the button.  
2325 The \fB\-relief\fR option determines if a border is to be drawn.  The
2326 default is \fB1\fR.
2327 .TP
2328 \fB\-closerelief \fIrelief\fR
2329 Specifies the 3-D effect for the closed button.  \fIRelief\fR
2330 indicates how the button should appear relative to the widget; 
2331 for example, \fBraised\fR means the button should
2332 appear to protrude.  The default is \fBsolid\fR.
2333 .TP
2334 \fB\-cursor \fIcursor\fR
2335 Sets the widget's cursor.  The default cursor is \fB""\fR.
2336 .TP
2337 \fB\-foreground \fIcolor\fR 
2338 Sets the foreground color of buttons. 
2339 The default is \fBblack\fR.
2340 .TP
2341 \fB\-images \fIimages\fR
2342 Specifies images to be displayed for the button.
2343 \fIImages\fR is a list of two Tk images: 
2344 the first image is displayed when the button is open, the
2345 second when it is closed.  If the \fIimages\fR is the empty string,
2346 then a plus/minus gadget is drawn.  The default is \fB""\fR.
2347 .TP
2348 \fB\-openrelief \fIrelief\fR
2349 Specifies the 3-D effect of the open button.  \fIRelief\fR
2350 indicates how the button should appear relative to the widget; 
2351 for example, \fBraised\fR means the button should
2352 appear to protrude.  The default is \fBflat\fR.
2353 .TP
2354 \fB\-size \fIpixels\fR
2355 Sets the requested size of the button.  
2356 The default is \fB0\fR.
2357 .SH "STYLE OPTIONS"
2358 Five style types are available: \fBtextbox, combobox, checkbox, barbox, windowbox\fR.
2359 Autocreated styles are by default of type \fBtextbox\fR.
2360 A \fBbarbox\fR provides progressbars for numeric cell values.
2361 The special style \fBwindowbox\fR supports embedded subwindows within data
2362 cells.
2363 .sp
2364 The resource subclass is the name of the style, titlized, ie.
2365 .CS
2366 option add *TreeView.TextBoxStyle.tvBackground white
2367 option add *TreeView.ComboBoxStyle.tvBackground green
2368 option add *TreeView.CheckBoxStyle.tvBackground blue
2369 .CE
2370 A default textbox style \fItext\fR comes predefined and is set for
2371 each columns \fI-style\fR option.
2372 Styles may also be associated with
2373 entry-rows and/or cells, as follows:
2374 .sp
2375 .CS
2376 treeview .t -width 300 -height 200
2377 pack .t -fill both -expand y
2378  .t col insert end Size Age Weight
2379  .t style create combobox MyStyle0 -bg red
2380  .t style create textbox MyStyle1 -bg blue
2381  .t style create textbox MyStyle2 -bg green
2382  .t style create textbox MyStyle3 -bg orange
2383
2384  .t col conf Size -style MyStyle0
2385  foreach i {Able Baker Charlie} {
2386   .t insert end $i -data {Size 1 Age 2 Weight 3}
2387  }
2388  .t entry conf 2 -style MyStyle2
2389  .t style set MyStyle3 Weight 3
2390  .t insert end Empty
2391  .t conf -emptystyle MyStyle1
2392 .CE
2393 .sp
2394 See also the widget options \fI-altstyle\fR, \fI-emptystyle\fR and \fI-levelstyles\fR.
2395 The following are available for all but the windowbox type.
2396 Note, some of these options are utilized only in particular contexts:
2397 .TP
2398 \fB\-activebackground \fIcolor\fR 
2399 Specifies the active background color of a style. 
2400 Alias is \fB\-activebg\fR.
2401 .TP
2402 \fB\-activeforeground \fIcolor\fR 
2403 Specifies the active foreground color of a style. 
2404 Alias is \fB\-activefg\fR.
2405 .TP
2406 \fB\-background \fIcolor\fR 
2407 Background color override.  Default is empty.
2408 .TP
2409 \fB\-cursor \fIcursorname\fR 
2410 Specifies the cursor of a style. This cursor for the widget when an
2411 element is activated.
2412 .TP
2413 \fB\-editopts \fIvalues\fR
2414 Cell option name/value pairs for the builtin text edit facilty.
2415 These are appended to the columns \fB-editopts\fR.
2416 See \fBcolumn -editopts\fR.
2417 .TP
2418 \fB\-font \fIfontName\fR 
2419 Sets the font for a style.
2420 .TP
2421 \fB\-foreground \fIcolor\fR 
2422 Specifies the foreground color of a style. 
2423 Alias is \fB\-fg\fR.
2424 .TP
2425 \fB\-gap \fIN\fR 
2426 Specifies the gap.
2427 .TP
2428 \fB\-hide \fIbool\fR 
2429 Values or subtext having a style with hide on are to be hidden.
2430 Columns and entries are unaffected.
2431 .TP
2432 \fB\-highlightbackground \fIcolor\fR 
2433 Specifies the highlight background color of a style. 
2434 Alias is \fB\-highlightbg\fR.
2435 .TP
2436 \fB\-highlightforeground \fIcolor\fR 
2437 Specifies the highlight foreground color of a style. 
2438 Alias is \fB\-highlightfg\fR.
2439 .TP
2440 \fB\-icon \fIname\fR 
2441 Specifies the icon.
2442 .TP
2443 \fB\-priority\fR \fIN\fR 
2444 Specifies a priority for the style.  Higher priorities
2445 are used for overriding bg/fg/font.  The default 0.
2446 .TP
2447 \fB\-readonly\fR \fIbool\fR 
2448 Disallow editing for a cell whose column has \fB-edit\fR set to true.
2449 The default is \fBFalse\fR.
2450 .TP
2451 \fB\-shadow \fIshadow\fR 
2452 Set shadow.
2453 .TP
2454 \fB\-tile \fIimg\fR 
2455 Set tiling.
2456 .TP
2457 The following additional configuration options are available for textbox:
2458 .TP
2459 \fB\-formatcmd \fIscriptcmd\fR 
2460 Command called to format the displayed key-data value.
2461 Percent substitutions are performed on \fIscriptcmd\fR as per \fIfind -exec\fR.
2462 The called command returns the value to be displayed.
2463 .TP
2464 \fB\-iconside \fIN\fR 
2465 Specifies which side of the text the icon is placed.  Default is left.
2466 .TP
2467 \fB\-side \fIN\fR 
2468 Specifies which side of cell to anchor contents.  Default is top.
2469 .TP
2470 The following additional configuration options are available for combobox:
2471 .TP
2472 \fB\-buttonicons \fIicons\fR 
2473 A pair of icons to use for the button icon.
2474 The second icon is drawn when \fBstyle activate\fR is used
2475 on a cell (managed automatically by the editing code).
2476 .TP
2477 \fB\-borderwidth \fIpixel\fR 
2478 Size of border.
2479 .TP
2480 \fB\-buttonborderwidth \fIpixel\fR 
2481 Size of buttons border
2482 .TP
2483 \fB\-buttonrelief \fIrelief\fR 
2484 Relief of button.
2485 .TP
2486 \fB\-choicecmd \fIcmd\fR 
2487 Command called to get the list of choices for editing,
2488 after the following substitutions: \fB%X %Y %C %# %W %%\fR.
2489 Used by the library proc \fIblt::tv::EditCell\fR which
2490 implements builtin editing.
2491 .TP
2492 \fB\-choicekey \fIkey\fR 
2493 Key field to in the current node to get the list of choices from.
2494 .TP
2495 \fB\-choices \fIlst\fR 
2496 A list of choices for editing.
2497 .TP
2498 The following additional configuration options are available for checkbox:
2499 .TP
2500 \fB\-boxcolor \fIcolor\fR 
2501 Color of box.
2502 .TP
2503 \fB\-boxsize \fInum\fR 
2504 Size of box.
2505 .TP
2506 \fB\-checkcolor \fIcolor\fR 
2507 Color of check.
2508 .TP
2509 \fB\-checkicons \fIimages\fR 
2510 A pair of icons to use to represent the on/off state
2511 instead of drawing a checkbox.
2512 .TP
2513 \fB\-fillcolor \fIcolor\fR 
2514 Color of fill.
2515 .TP
2516 \fB\-halo \fInum\fR 
2517 Halo around checkbox in which to accept a click.  If \fInum\fR is less
2518 than zero, accept a click anywhere in the cell.  The default is \fB0\fR.
2519 .TP
2520 \fB\-linewidth \fInum\fR 
2521 Line size.
2522 .TP
2523 \fB\-offvalue \fIval\fR 
2524 Value representing off.
2525 .TP
2526 \fB\-onvalue \fIval\fR 
2527 Value representing on.
2528 .TP
2529 \fB\-showvalue \fIbool\fR 
2530 Show value as well..
2531 .TP
2532 The following additional configuration options are available for barbox:
2533 .TP
2534 \fB\-barbg \fIcolor\fR 
2535 Color for the background of the bar.
2536 Default is the empty string.
2537 .TP
2538 \fB\-boxcolor \fIcolor\fR 
2539 Color of box around bar.
2540 .TP
2541 \fB\-barfg \fIcolor\fR 
2542 Color for the foreground of the bar.
2543 Default is green.
2544 .TP
2545 \fB\-barheight \fInum\fR 
2546 Height of bar.  Default 10.
2547 .TP
2548 \fB\-barwidth \fInum\fR 
2549 Width of bar.  Default 80.
2550 .TP
2551 \fB\-filltile \fItile\fR 
2552 Image to tile-fill bar with.
2553 .TP
2554 \fB\-formatcmd \fIscriptcmd\fR 
2555 Command called to format the displayed value.
2556 Percent substitutions are performed on \fIscriptcmd\fR as per \fIfind -exec\fR.
2557 The called command returns the value to be displayed.
2558 .TP
2559 \fB\-linewidth \fInum\fR 
2560 Width of border around the bar.  Default is 1.
2561 .TP
2562 \fB\-maxvalue \fIval\fR 
2563 The maxiumum value.  Default is 100.0.
2564 .TP
2565 \fB\-minvalue \fIval\fR 
2566 The miniumum value.  Default is 0.0.
2567 .TP
2568 \fB\-showvalue \fIbool\fR 
2569 Show the numeric value.
2570 .TP
2571 Only the following configuration options are available with windowbox:
2572 .TP
2573 \fB\-minheight \fInum\fR 
2574 Minimum height of window.
2575 Window height will be taller if the
2576 the entry height is greater than num.
2577 Default is 0.
2578 .TP
2579 \fB\-minwidth \fInum\fR 
2580 Minimum width of window.  Window width will be wider if the
2581 the column width is greater than num.
2582 Default is 0.
2583 .TP
2584 \fB\-sticky \fIval\fR 
2585 Stickiness of the window inside the cell, as defined by the \fBgrid\fR command.
2586 The default value is \fBw\fR.
2587 .TP
2588 \fB\-windowcmd \fIstring\fR 
2589 Command invoked to return window path.
2590 Percent substitutions are performed on \fIstring\fR before 
2591 it is executed.  The following substitutions are valid:
2592 .RS 
2593 .TP 5
2594 \fB%W\fR
2595 The pathname of the widget.
2596 .TP 5
2597 \fB%p\fR
2598 The name of the node.
2599 .TP 5
2600 \fB%P\fR
2601 The full pathname of the node.
2602 .TP 5
2603 \fB%#\fR
2604 The id of the node.
2605 .TP 5
2606 \fB%C\fR
2607 The column identifier.
2608 .TP 5
2609 \fB%%\fR
2610 Translates to a single percent.
2611 .RE
2612 .SH "COLUMN OPTIONS"
2613 Column configuration options may also be set by the \fBoption\fR command.
2614 The resource subclass is \fBColumn\fR.   The resource name is the 
2615 name of the column.
2616 .CS
2617 option add *TreeView.Column.Foreground white
2618 option add *TreeView.treeView.Background blue
2619 .CE
2620 The following configuration options are available for columns.
2621 .TP
2622 \fB\-activetitlebackground \fIcolor\fR
2623 Active title background color.
2624 .TP
2625 \fB\-activetitleforeground \fIcolor\fR
2626 Active title foreground color.
2627 .TP
2628 \fB\-autowidth \fIvalue\fR
2629 If the maximum width of a column exceeds the given
2630 value, then the column width uses this value instead \fB\-width\fR.
2631 When value is zero or \fB\-width\fR is non-zero, has no effect.
2632 Allows setting a default column width limit, while still
2633 permitting the user to manually resize larger (unlike \fB-max\fR).
2634 The default value is 0.
2635 .TP
2636 \fB\-background \fIcolor\fR
2637 Sets the background color of the column.  This overrides
2638 the widget's \fB\-background\fR option. The default is \fBwhite\fR.
2639 .TP
2640 \fB\-bindtags \fIstring\fR
2641 Set binding tags for column.
2642 .TP
2643 \fB\-borderwidth \fIpixels\fR
2644 Sets the width of the 3\-D border of the column.  
2645 The \fB\-relief\fR option determines if a border is to be drawn.  The
2646 default is \fB0\fR.
2647 .TP
2648 \fB\-colorpattern \fIpatcolors\fR
2649 Alter foreground color based on a string match against the cell data value.
2650 Pattern/color pairs are specified in \fIpatcolors\fR.
2651 If the pattern matches, then color becomes the foreground
2652 of the data cell.
2653 This provides a low-overhead way to display different colors
2654 depending only on the form of data.
2655 .TP
2656 \fB\-colorregexp \fIpatcolors\fR
2657 Does the same thing as \fB\-colorpattern\fR, except uses
2658 regexp instead, and has a lower priority.
2659 .TP
2660 \fB\-command \fIstring\fR
2661 Set command for use by \fBinvoke\fR.  This is called everytime the column
2662 is selected.  For example, sortable columns can
2663 be enabled by a setting this to \fI{blt::tv::SortColumn %W %C}\fR,
2664 or sort tree children of with \fI{blt::tv::SortTree %W %C}\fR.
2665 Note that SortColumn can temporarily change the treeview mode to -flat.
2666 The following substitutions are valid:
2667 .RS 
2668 .TP 5
2669 \fB%W\fR
2670 The pathname of the widget.
2671 .TP 5
2672 \fB%C\fR
2673 The column identifier.
2674 .TP 5
2675 \fB%%\fR
2676 Translates to a single percent.
2677 .RE
2678 .TP
2679 \fB\-edit \fInum\fR
2680 Indicates if the column's data fields can be edited
2681 via the builtin editing facility. If \fInum\fR is 
2682 True the data fields in the column can be edited.
2683 The default is \fBFalse\fR.
2684 .TP
2685 \fB\-editopts \fIvalues\fR
2686 Sub-option pair settings for the builtin text edit facilty implemented by
2687 \fI::blt::tv::EditCol\fR.
2688 Note, these are used only for cells with a style type of \fBtextbox\fR
2689 and \fBcombobox\fR.
2690 Following is partial documentation of the fBtextbox\fR
2691 (or see \fI::blt::tv::EditCol\fR \fI$blt_library/treeview.tcl\fR).
2692 .RS 
2693 .TP 5
2694 \fI-allowtypes type\fR
2695 List of types to allow text editing for, or \fB*\fR for all.
2696 The default is  \fBtextbox\fR.
2697 .TP 5
2698 \fI-autonl bool\fR
2699 Automatically use either an entry, spinbox or text as appropriate.
2700 The default is to use an entry widget.
2701 Text containing newlines will use a text widget.
2702 A column with combobox style where -choices or -choicecmd is set will use
2703 a spinbox.
2704 .TP 5
2705 \fI-choices list\fR
2706 List of choices for spinbox/combo.
2707 .TP 5
2708 \fI-conf values\fR
2709 Options to pass directly to the widget.
2710 .TP 5
2711 \fI-embed bool\fR
2712 When True the edit window is managed internally via an embedded
2713 windowbox style. When false \fBplace\fR is used to manage the window.
2714 The default is \fIFalse\fR.
2715 An embedded window has
2716 advantages but will result in a re-layout at the begin and end of editing.
2717 Note: place is always used for the tree column.
2718 .TP 5
2719 \fI-endcmd cmd\fR
2720 Command to call at end of edit, after the new value is set.
2721 If a percent is found, command substitution occurs,
2722 otherwise the call appends 5 arguments: \fIwidget data olddata ind col\fR.
2723 .TP 5
2724 \fI-leafs bool\fR
2725 Limit editing to leafs only.  Default is \fIfalse\fR.
2726 .TP 5
2727 \fI-nlkeys opt\fR
2728 Keys for inserting newline in multiline edits.
2729 The default value is: \fB<Control-r> <Shift-Return>\fR.
2730 .TP 5
2731 \fI-nottnull bool\fR
2732 Do not edit empty fields that have not had data assigned to them.
2733 Default is \fIfalse\fR.
2734 .TP 5
2735 \fI-optscmd cmd\fR
2736 Command called to get options.  Called with 3 args: widget ind col.
2737 Returns name/value pairs which are
2738 additional options as accepted by \fI-editopts\fR.
2739 To indicate that a cell is non-editable, return \fB{-readonly True}\fR.
2740 .TP 5
2741 \fI-readonly bool\fR
2742 Cell is readonly.  Do not edit.
2743 .TP 5
2744 \fI-sel bool\fR
2745 Value is initially selected in edit window.
2746 Default is \fItrue\fR.
2747 .TP 5
2748 \fI-startcmd cmd\fR
2749 Command to call at start of edit.
2750 If a percent is found, command substitution occurs,
2751 otherwise the 3 arguments are appended: widget ind col.
2752 .TP 5
2753 \fI-tab opts\fR
2754 Setup a bind for Tab in the edit window (bool or args passed to TabMove).
2755 .TP 5
2756 \fI-titles bool\fR
2757 Enable editing of the title label.  Default is \fIfalse\fR.
2758 .TP 5
2759 \fI-treelabel bool\fR
2760 Edit -tree cmd label rather than treeview label.
2761 Default is \fBtrue\fR.
2762 .TP 5
2763 \fI-type bool\fR
2764 A basic wize type eg. bool, int, choice
2765 .TP 5
2766 \fI-typecol column\fR
2767 Column/key to get -type from.
2768 .TP 5
2769 \fI-vcmd cmd\fR
2770 Command to override the columns \fB-validatecmd\fR.
2771 .TP 5
2772 \fI-widget wid\fR
2773 The widget to use. Builtin support types are: \fIspinbox, text, entry\fR.
2774 The default is \fIentry\fR.
2775 .TP 5
2776 \fI-withtag tag\fR
2777 Edit only if has tag.
2778 .TP 5
2779 \fI-withouttag tag\fR
2780 Edit only if does not have tag.
2781 .TP 5
2782 \fI-wrap value\fR
2783 Setting for wrap mode when edit window is a text widget.  Default is \fInone\fR.
2784 .RE
2785 For more generalized control of
2786 editing, bind to the <<TreeViewEditStart/End>> virtual
2787 events.
2788 .TP
2789 \fB\-font \fIfont\fR 
2790 Sets the font for the column.
2791 Currently, should not be mixed this with and a \fB-style\fR a font
2792 for the column.
2793 .TP
2794 \fB\-foreground \fIcolor\fR 
2795 Sets the text color the column.
2796 .TP
2797 \fB\-fillcmd \fIscriptcmd\fR
2798 Demand load data into unset values, just prior to display.
2799 The call occurs the first time each entry is displayed in the column.
2800 Only cells not having a value/label set are updated.
2801 Before calling, the id is appended.  The new value
2802 should be returned.
2803 For tree columns the result is used to set the entry label, otherwise
2804 it sets a data cell value.
2805 If an error is raised, the value is set to the empty string.
2806 .sp
2807 Here is an example that loads a large tree.  It demonstrates that only the
2808 first dozen or so are update initially, and more as you scroll.
2809 A practical example might load data from a database.
2810 .CS
2811
2812   set t [tree create]
2813   $t create -num 10000
2814   pack [treeview .t -tree $t]
2815
2816   proc FillLabel {id} { puts "L$id"; return L$id }
2817   proc FillData {id} { return D$id }
2818   .t col conf #0 -fillcmd FillLabel
2819   .t col insert end A -fillcmd FillData
2820 .CE
2821 .TP
2822 \fB\-hide \fIboolean\fR
2823 If \fIboolean\fR is true, the column is not displayed.
2824 The default is \fBno\fR.
2825 .TP
2826 \fB\-justify \fIjustify\fR
2827 Specifies how the column data fields text should be justified within
2828 the column.  This matters only when the column is wider than the 
2829 data field to be display.
2830 \fIJustify\fR must be \fBleft\fR, \fBright\fR, or \fBcenter\fR.  
2831 The default is \fBcenter\fR.
2832 .TP
2833 \fB\-max \fIsize\fR
2834 Maximum size for column.
2835 .TP
2836 \fB\-min \fIsize\fR
2837 Minimum size for column.
2838 .TP
2839 \fB\-pad \fIpad\fR
2840 Specifies how much padding for the left and right sides of the column.
2841 \fIPad\fR is a list of one or two screen distances.  If \fIpad\fR
2842 has two elements, the left side of the column is padded by the first
2843 distance and the right side by the second.  If \fIpad\fR has just one
2844 distance, both the left and right sides are padded evenly.  The
2845 default is \fB2\fR.
2846 .TP
2847 \fB\-relief \fIrelief\fR
2848 Specifies the 3-D effect of the column.  \fIRelief\fR
2849 specifies how the column should appear relative to the widget; 
2850 for example, \fBraised\fR means the column should
2851 appear to protrude.  The default is \fBflat\fR.
2852 .TP
2853 \fB\-ruledashes \fIvalue\fR
2854 Set resize rule is dashed.
2855 .TP
2856 \fB\-scrolltile \fIbool\fR
2857 Tile image scrolls.
2858 .TP
2859 \fB\-sortaltcolumns \fIlist\fR
2860 List of alternate columns sort can use when cell values are equal.
2861 It is an error to include the current or tree column.
2862 .TP
2863 \fB\-sortcommand \fIscript\fR
2864 Command to actually compare entries during sort.
2865 .TP
2866 \fB\-sortmode \fImode\fR
2867 Used by scripts to set -mode for sort command (eg. blt::tv::SortColumn).
2868 .TP
2869 \fB\-state \fIstate\fR
2870 Sets the state of the column. If \fIstate\fR is \fBdisable\fR then
2871 the column title can not be activated nor invoked.
2872 The default is \fBnormal\fR.
2873 .TP
2874 \fB\-style \fIstylename\fR
2875 Set the style to use for column.
2876 .TP
2877 \fB\-tile \fIimage\fR
2878 Image to tile column with.
2879 .TP
2880 \fB\-title \fIstring\fR
2881 Sets the title for the column.
2882 The default is \fB""\fR.
2883 .TP
2884 \fB\-titlearrow \fIvalue\fR
2885 Forces an arrow to be drawn in the title.
2886 The \fIvalue\fR is one of: \fBleft right up down none\fR 
2887 and defaults to \fBnone\fR.
2888 This is used when implementing custom sorts as the indicator.
2889 .TP
2890 \fB\-titlebackground \fIcolor\fR 
2891 Background for title.
2892 .TP
2893 \fB\-titleborderwidth \fIsize\fR 
2894 Border size.
2895 .TP
2896 \fB\-titlefont \fIfont\fR
2897 Font for column title.
2898 .TP
2899 \fB\-titlejustify \fIjust\fR
2900 Side to place title.
2901 .TP
2902 \fB\-titleforeground \fIcolor\fR 
2903 Sets the foreground color of the column title. 
2904 The default is \fBblack\fR.
2905 .TP
2906 \fB\-titlerelief \fIrelief\fR 
2907 Relief for title.
2908 .TP
2909 \fB\-titleshadow \fIcolor\fR 
2910 Sets the color of the drop shadow of the column title.  
2911 The default is \fB""\fR.
2912 .TP
2913 \fB\-titlestyle \fIstyle\fR 
2914 A style to use for titles.
2915 .TP
2916 \fB\-width \fInum\fR
2917 The user requested width for the column.
2918 .TP
2919 \fB\-underline \fInum\fR
2920 Character to underline in column title text.  Default is -1.
2921 .TP
2922 \fB\-validatecmd \fIcommand\fR
2923 This option provides a command for validating or post processing edits
2924 from the builtin column edit feature
2925 (enabled with \fIcol conf -edit 1\fR).
2926 If a percent is found, command substitution occurs,
2927 otherwise 5 arguments are appended: \fIwidget data olddata ind col\fR.
2928 The called command should return \fInewvalue\fR, possibly with modifications.
2929 To revert to the original value, just return \fI$oldvalue\fR
2930 To continue editing, use \fBreturn -code return\fR
2931 .RE
2932 .TP
2933 \fB\-weight \fIfloat\fR 
2934 Weighting to apply extra space.
2935 .TP
2936 \fB\-width \fIpixels\fR
2937 Sets the requested width of the column.  This overrides
2938 the computed with of the column.  If \fIpixels\fR is 0,
2939 the width is computed as from the contents of the column. The
2940 default is \fB0\fR.
2941 .SH "EMBEDDED WINDOWS"
2942 Embedded windows is supported for columns or cells via the special
2943 style type \fBwindowbox\fR.
2944 If \fI-windowcmd\fR is not being used, the cell data
2945 is assumed to contain the widget name, or tail part of a widget name.
2946 If the data does not provide a valid window it is silently ignored and
2947 nothing is displayed.
2948 If multiple cells try to display the same widget simultaneously,
2949 only the first one appears.
2950 The normal Tk slave window rules apply (ie. must be child of the parent).
2951 .sp
2952 .SH "OLD TEXT EDITING OPTIONS"
2953 \fBSECTION OBSOLETE\fR.
2954 .sp
2955 This section is obsolete and has been replaced with builtin editing using
2956 a Tk entry widget.  See \fBTREEVIEW EDITING\fR above.
2957 .sp
2958 Text edit window configuration options may also be set by the Tk
2959 \fBoption\fR command. The resource class is \fBTreeViewEditor\fR.
2960 The resource name is always \fBedit\fR.
2961 .CS
2962 option add *TreeViewEditor.Foreground white
2963 option add *edit.Background blue
2964 .CE
2965 The following are the configuration options available for the
2966 text editing window.
2967 .TP
2968 \fB\-background \fIcolor\fR
2969 Sets the background of the text edit window.  The default is \fBwhite\fR.
2970 .TP
2971 \fB\-borderwidth \fIpixels\fR
2972 Sets the width of the 3\-D border around the edit window.  
2973 The \fB\-relief\fR option determines if a border is to be drawn.  The
2974 default is \fB1\fR.
2975 .TP
2976 \fB\-exportselection \fIboolean\fR
2977 Indicates if the text selection is exported.  If the edit window is 
2978 exporting its selection then it will observe the standard X11 protocols 
2979 for handling the selection.  Selections are available as type \fBSTRING\fR.
2980 The default is \fBno\fR.
2981 .TP
2982 \fB\-relief \fIrelief\fR
2983 Specifies the 3-D effect of the edit window.  \fIRelief\fR
2984 indicates how the background should appear relative to the edit
2985 window; for example, \fBraised\fR means the background should
2986 appear to protrude.  The default is \fBsolid\fR.
2987 .TP
2988 \fB\-selectbackground \fIcolor\fR
2989 Sets the background of the selected text in the edit window.  
2990 The default is \fBwhite\fR.
2991 .TP
2992 \fB\-selectborderwidth \fIpixels\fR
2993 Sets the width of the 3\-D border around the selected text in the 
2994 edit window.  The \fB\-selectrelief\fR option determines if a border 
2995 is to be drawn.  The default is \fB1\fR.
2996 .TP
2997 \fB\-selectforeground \fIcolor\fR
2998 Sets the foreground of the selected text in the edit window.  
2999 The default is \fBwhite\fR.
3000 .TP
3001 \fB\-selectrelief \fIrelief\fR
3002 Specifies the 3-D effect of the selected text in the edit window.  
3003 \fIRelief\fR indicates how the text should appear relative to the edit
3004 window; for example, \fBraised\fR means the text should
3005 appear to protrude.  The default is \fBflat\fR.
3006 .SH "DEFAULT BINDINGS"
3007 Tk automatically creates class bindings for treeviews that give them
3008 Motif-like behavior.  Much of the behavior of a \fBtreeview\fR widget is determined
3009 by its \fB\-selectmode\fR option, which selects one of two ways
3010 of dealing with the selection.
3011 .PP
3012 If the selection mode is \fBsingle\fR, only one node can be 
3013 selected at a time.
3014 Clicking button 1 on an node selects
3015 it and deselects any other selected item.
3016 .PP
3017 If the selection mode is \fBmultiple\fR,
3018 any number of entries may be selected at once, including discontiguous
3019 ranges.  Clicking Control-Button-1 on a node entry
3020 toggles its selection state without affecting any other entries.
3021 Pressing Shift-Button-1 on a node entry selects
3022 it, extends the selection.
3023 .IP [0]
3024 The virtual event <<TreeViewFocusEvent>> is generated for each
3025 keyboard and mouse initiated change in focus.  It is up to
3026 the user to determine if the focus actually changed.
3027 .IP [1]
3028 In \fBextended\fR mode, the selected range can be adjusted by pressing
3029 button 1 with the Shift key down:  this modifies the selection to
3030 consist of the entries between the anchor and the entry under
3031 the mouse, inclusive.
3032 The un-anchored end of this new selection can also be dragged with
3033 the button down.
3034 .IP [2]
3035 In \fBextended\fR mode, pressing button 1 with the Control key down
3036 starts a toggle operation: the anchor is set to the entry under
3037 the mouse, and its selection state is reversed.  The selection state
3038 of other entries isn't changed.
3039 If the mouse is dragged with button 1 down, then the selection state
3040 of all entries between the anchor and the entry under the mouse
3041 is set to match that of the anchor entry;  the selection state of
3042 all other entries remains what it was before the toggle operation
3043 began.
3044 .IP [3]
3045 If the mouse leaves the treeview window with button 1 down, the window
3046 scrolls away from the mouse, making information visible that used
3047 to be off-screen on the side of the mouse.
3048 The scrolling continues until the mouse re-enters the window, the
3049 button is released, or the end of the hierarchy is reached.
3050 .IP [4]
3051 Mouse button 2 may be used for scanning.
3052 If it is pressed and dragged over the \fBtreeview\fR widget, the contents of
3053 the hierarchy drag at high speed in the direction the mouse moves.
3054 .IP [5]
3055 If the Up or Down key is pressed, the location cursor (active
3056 entry) moves up or down one entry, as does Control-p and Control-n.
3057 If the selection mode is \fBbrowse\fR or \fBextended\fR then the
3058 new active entry is also selected and all other entries are
3059 deselected.
3060 In \fBextended\fR mode the new active entry becomes the
3061 selection anchor.
3062 .IP [6]
3063 In \fBextended\fR mode, Shift-Up and Shift-Down move the location
3064 cursor (active entry) up or down one entry and also extend
3065 the selection to that entry in a fashion similar to dragging
3066 with mouse button 1.
3067 .IP [7]
3068 The Left and Right keys scroll the \fBtreeview\fR widget view left and right
3069 by the width of the character \fB0\fR.
3070 Control-Left and Control-Right scroll the \fBtreeview\fR widget view left and
3071 right by the width of the window.
3072 .IP [8]
3073 The Prior and Next keys scroll the \fBtreeview\fR widget view up and down
3074 by one page (the height of the window), as does Control-u and Control-d.
3075 .IP [9]
3076 The Home and End keys scroll the \fBtreeview\fR widget horizontally to
3077 the left and right edges, respectively.
3078 .IP [10]
3079 Control-Home sets the location cursor to the first entry, 
3080 selects that entry, and deselects everything else
3081 in the widget.
3082 .IP [11]
3083 Control-End sets the location cursor to the last entry, 
3084 selects that entry, and deselects everything else
3085 in the widget.
3086 .IP [12]
3087 In \fBextended\fR mode, Control-Shift-Home extends the selection
3088 to the first entry and Control-Shift-End extends
3089 the selection to the last entry.
3090 .IP [13]
3091 In \fBmultiple\fR mode, Control-Shift-Home moves the location cursor
3092 to the first entry and Control-Shift-End moves
3093 the location cursor to the last entry.
3094 .IP [14]
3095 The space and Select keys make a selection at the location cursor
3096 (active entry) just as if mouse button 1 had been pressed over
3097 this entry.
3098 .IP [15]
3099 In \fBextended\fR mode, Control-Shift-space and Shift-Select
3100 extend the selection to the active entry just as if button 1
3101 had been pressed with the Shift key down.
3102 .IP [16]
3103 In \fBextended\fR mode, the Escape key cancels the most recent
3104 selection and restores all the entries in the selected range
3105 to their previous selection state.
3106 .IP [17]
3107 Control-slash selects everything in the widget, except in
3108 \fBsingle\fR and \fBbrowse\fR modes, in which case it selects
3109 the active entry and deselects everything else.
3110 .IP [18]
3111 Control-backslash deselects everything in the widget, except in
3112 \fBbrowse\fR mode where it has no effect.
3113 .IP [19]
3114 The F16 key (labelled Copy on many Sun workstations) or Meta-w
3115 copies the selection in the widget to the clipboard, if there is
3116 a selection.
3117 .PP
3118 The behavior of \fBtreeview\fR widgets can be changed by defining new bindings 
3119 for individual widgets or by redefining the class bindings.
3120 .SS WIDGET BINDINGS
3121 In addition to the above behavior, the following additional behavior
3122 is defined by the default widget class (TreeView) bindings.
3123 .IP \fB<ButtonPress-2>\fR 
3124 Starts scanning. 
3125 .IP \fB<B2-Motion>\fR 
3126 Adjusts the scan.
3127 .IP \fB<ButtonRelease-2>\fR
3128 Stops scanning.
3129 .IP \fB<B1-Leave>\fR 
3130 Starts auto-scrolling.
3131 .IP \fB<B1-Enter>\fR
3132 Starts auto-scrolling 
3133 .IP \fB<KeyPress-Up>\fR 
3134 Moves the focus to the previous entry.
3135 .IP \fB<KeyPress-Down>\fR 
3136 Moves the focus to the next entry.
3137 .IP \fB<Shift-KeyPress-Up>\fR
3138 Moves the focus to the previous sibling.
3139 .IP \fB<Shift-KeyPress-Down>\fR
3140 Moves the focus to the next sibling.
3141 .IP \fB<KeyPress-Prior>\fR 
3142 Moves the focus to first entry.  Closed or hidden entries
3143 are ignored.
3144 .IP \fB<KeyPress-Next>\fR 
3145 Move the focus to the last entry. Closed or hidden entries
3146 are ignored.
3147 .IP \fB<KeyPress-Left>\fR 
3148 Closes the entry.  It is not an error if the entry has no children.
3149 .IP \fB<KeyPress-Right>\fR 
3150 Opens the entry, displaying its children.  It is not an
3151 error if the entry has no children.
3152 .IP \fB<KeyPress-space>\fR 
3153 In "single" select mode this selects the entry.  In "multiple" mode,
3154 it toggles the entry (if it was previous selected, it is not
3155 deselected).
3156 .IP \fB<KeyRelease-space>\fR 
3157 Turns off select mode.
3158 .IP \fB<KeyPress-Return>\fR 
3159 Sets the focus to the current entry.
3160 .IP \fB<KeyRelease-Return>\fR 
3161 Turns off select mode.
3162 .IP \fB<KeyPress>\fR 
3163 Moves to the next entry whose label starts with the letter typed.
3164 .IP \fB<KeyPress-Home>\fR 
3165 Moves the focus to first entry.  Closed or hidden entries
3166 are ignored.
3167 .IP \fB<KeyPress-End>\fR 
3168 Move the focus to the last entry. Closed or hidden entries
3169 are ignored.
3170 .IP \fB<Control-a>\fR 
3171 Move to parent of current entry.
3172 .IP \fB<Control-o>\fR 
3173 Open current entry.
3174 .IP \fB<Control-Shift-O>\fR 
3175 Open current entry recursively.
3176 .IP \fB<Double-ButtonRelease-1>\fR 
3177 Edit cell.
3178 .IP \fB<Alt-Double-ButtonRelease-1>\fR 
3179 Edit cell.
3180 .IP \fB<Control-KeyPress-minus>\fR 
3181 Close parent of current entry.
3182 .IP \fB<Control-F1>\fR 
3183 Opens all tree nodes.
3184 .IP \fB<Control-F2>\fR
3185 Closes all tree nodes (except root).
3186 .IP \fB<Control-F3>\fR
3187 Toggle flat mode.
3188 .IP \fB<Control-F4>\fR
3189 Reset all column widths back to 0 allowing autosizing.
3190 .IP \fB<Control-Shift-O>\fR 
3191 Open focus tree node recursively.
3192 .IP \fB<Control-Shift-C>\fR 
3193 Close focus tree node recursively.
3194 .SS BUTTON BINDINGS
3195 Buttons have bindings.  There are associated with the "all" bindtag
3196 (see the entry's -bindtag option).  You can use the \fBbind\fR
3197 operation to change them.
3198 .IP \fB<Enter>\fR 
3199 Highlights the button of the current entry.
3200 .IP \fB<Leave>\fR 
3201 Returns the button back to its normal state.
3202 .IP \fB<ButtonRelease-1>\fR
3203 Adjust the view so that the current entry is visible.
3204 .SS ENTRY BINDINGS
3205 Entries have default bindings.  There are associated with the "all"
3206 bindtag (see the entry's -bindtag option).  You can use the \fBbind\fR
3207 operation to modify them.
3208 .IP \fB<Enter>\fR 
3209 Highlights the current entry.
3210 .IP \fB<Leave>\fR 
3211 Returns the entry back to its normal state.
3212 .IP \fB<ButtonPress-1>\fR 
3213 Sets the selection anchor the current entry.
3214 .IP \fB<Double-ButtonPress-1>\fR
3215 Toggles the selection of the current entry.
3216 .IP \fB<B1-Motion>\fR
3217 For "multiple" mode only.  Saves the current location of the
3218 pointer for auto-scrolling.  Resets the selection mark.  
3219 .IP \fB<ButtonRelease-1>\fR
3220 For "multiple" mode only.  Sets the selection anchor to the 
3221 current entry.
3222 .IP \fB<Shift-ButtonPress-1>\fR
3223 For "multiple" mode only. Extends the selection.
3224 .IP \fB<Shift-Double-ButtonPress-1>\fR 
3225 Place holder. Does nothing.
3226 .IP \fB<Shift-B1-Motion>\fR 
3227 Place holder. Does nothing.
3228 .IP \fB<Shift-ButtonRelease-1>\fR 
3229 Stop auto-scrolling.
3230 .IP \fB<Control-ButtonPress-1>\fR 
3231 For "multiple" mode only.  Toggles and extends the selection.
3232 .IP \fB<Control-Double-ButtonPress-1>\fR
3233 Place holder. Does nothing.
3234 .IP \fB<Control-B1-Motion>\fR 
3235 Place holder. Does nothing.
3236 .IP \fB<Control-ButtonRelease-1>\fR 
3237 Stops auto-scrolling.
3238 .IP \fB<Control-Shift-ButtonPress-1>\fR 
3239 ???
3240 .IP \fB<Control-Shift-Double-ButtonPress-1>\fR
3241 Place holder. Does nothing.
3242 .IP \fB<Control-Shift-B1-Motion>\fR 
3243 Place holder. Does nothing.
3244 .SS COLUMN BINDINGS
3245 Columns have bindings too.  They are associated with the column's
3246 "all" bindtag (see the column -bindtag option).  You can use the
3247 \fBcolumn bind\fR operation to change them.
3248 .IP \fB<Enter>\fR 
3249 Highlights the current column title.
3250 .IP \fB<Leave>\fR 
3251 Returns the column back to its normal state.
3252 .IP \fB<ButtonRelease-1>\fR
3253 Invokes the command (see the column's -command option) if one
3254 if specified.  
3255 .SS COLUMN RULE BINDINGS
3256 These are bindings associated with the tag \fBRule\fR.
3257 .IP \fB<Enter>\fR 
3258 Highlights the current and activates the ruler.
3259 .IP \fB<Leave>\fR 
3260 Returns the column back to its normal state. Deactivates the
3261 ruler.
3262 .IP \fB<ButtonPress-1>\fR 
3263 Sets the resize anchor for the column.
3264 .IP \fB<B1-Motion>\fR 
3265 Sets the resize mark for the column.
3266 .IP \fB<ButtonRelease-1>\fR 
3267 Adjust the size of the column, based upon the resize anchor and mark
3268 positions.
3269 .SH QUICKSTART 
3270 TreeFill is a utility function to simplify tree data loading
3271 from a human-readable string.  The string
3272 uses line indentation to indicate tree depth.
3273 The indentation is in multiples of 4 spaces, relative to the first line. eg.
3274 .CS
3275  pack [treeview .t]
3276  .t column insert end X Y Z
3277  blt::tv::TreeFill .t {
3278      A 1 2 3
3279      B 4 5 6
3280          x 7 8 9
3281          y 10 11 12
3282              a 1 2 "Level a"
3283              b 1 2 "Level b"
3284      C 1 2 3
3285  }
3286  .t open -trees all
3287  .t entry conf 0->B->y->a -state disabled
3288 .CE
3289 Any column names not defined are generated.
3290 To load a table instead of a tree, simply set the -flat option first. eg.
3291 .CS
3292  pack [treeview .t -flat 1]
3293  .t column conf #0 -hide 1
3294  .t column insert end Name Age Sex
3295  blt::tv::TreeFill .t {
3296      "Tom Brown" 9 M
3297      "Mike Small" 8 M
3298      "Tina Baker" 7 F
3299  }
3300 .CE
3301 .SH EXAMPLE
3302 The \fBtreeview\fR command creates a new widget.  
3303 .CS
3304 treeview .t \-bg white
3305 .CE
3306 A new Tcl command \fB.t\fR is also created.  This command can be used
3307 to query and modify the \fBtreeview\fR widget.  For example, to change the 
3308 background
3309 color of the table to "green", you use the new command and the widget's
3310 \fBconfigure\fR operation.
3311 .CS
3312 # Change the background color.
3313 \&.t configure \-background "green"
3314 .CE
3315 By default, the \fBtreeview\fR widget will automatically create a new tree object
3316 to contain the data.  The name of the new tree is the pathname of the
3317 widget.  Above, the new tree object name is ".t".  But you can use the
3318 \fB\-tree\fR option to specify the name of another tree.
3319 .CS
3320 # View the tree "myTree".
3321 \&.t configure \-tree "myTree"
3322 .CE
3323 When a new tree is created, it contains only a root node.  The node
3324 is automatically opened.  The id of the root node is always
3325 \fB0\fR (you can use also use the special id \fBroot\fR). The
3326 \fBinsert\fR operation lets you insert one or more new entries into
3327 the tree.  The last argument is the node's \fIpathname\fR.  
3328 .CS
3329 # Create a new entry named "myEntry"
3330 set id [\&.t insert end "myEntry"]
3331 .CE
3332 This appends a new node named "myEntry".  It will positioned as the
3333 last child of the root of the tree (using the position "end").  You
3334 can supply another position to order the node within its siblings.
3335 .CS
3336 # Prepend "fred".
3337 set id [\&.t insert 0 "fred"]
3338 .CE
3339 Entry names do not need to be unique.  By default, the node's label
3340 is its name.  To supply a different text label, add the \fB\-label\fR
3341 option.
3342 .CS
3343 # Create a new node named "fred"
3344 set id [\&.t insert end "fred" -label "Fred Flintstone"]
3345 .CE
3346 The \fBinsert\fR operation returns the id of the new node.  You can
3347 also use the \fBindex\fR operation to get this information.
3348 .CS
3349 # Get the id of "fred"
3350 \&.t index "fred"
3351 .CE
3352 To insert a node somewhere other than root, use the \fB\-at\fR switch.
3353 It takes the id of the node where the new child will be added.
3354 .CS
3355 # Create a new node "barney" in "fred".
3356 \&.t insert end "barney" -at $id
3357 .CE
3358 A pathname describes the path to an entry in the hierarchy.  It's a
3359 list of entry names that compose the path in the tree.  Therefore, you
3360 can also add "barney" to "fred" as follows.
3361 .CS
3362 # Create a new sub-entry of "fred"
3363 \&.t insert end "fred barney" 
3364 .CE
3365 Every name in the list is ancestor of the next.  All ancestors must
3366 already exist.  That means that an entry "fred" is an ancestor of
3367 "barney" and must already exist.  But you can use the
3368 \fB\-autocreate\fR configuration option to force the creation of
3369 ancestor nodes.
3370 .CS
3371 # Force the creation of ancestors.
3372 \&.t configure -autocreate yes 
3373 \&.t insert end "fred barney wilma betty" 
3374 .CE
3375 Sometimes the pathname is already separated by a character sequence
3376 rather than formed as a list.  A file name is a good example of this.
3377 You can use the \fB\-separator\fR option to specify a separator string
3378 to split the path into its components.  Each pathname inserted is
3379 automatically split using the separator string as a separator.
3380 Multiple separators are treated as one.
3381 .CS
3382 \&.t configure -separator /
3383 \&.t insert end "/usr/local/tcl/bin" 
3384 .CE
3385 If the path is prefixed by extraneous characters, you can
3386 automatically trim it off using the \fB\-trim\fR option.  It removed
3387 the string from the path before it is parsed.
3388 .CS
3389 \&.t configure -trim C:/windows -separator /
3390 \&.t insert end "C:/window/system" 
3391 .CE
3392 .PP
3393 You can delete entries with the \fBdelete\fR operation.  It takes one or
3394 more tags of ids as its argument. It deletes the entry and all its
3395 children.
3396 .CS
3397 \&.t delete $id
3398 .CE
3399 Entries have several configuration options.  They control the appearance
3400 of the entry's icon and label.  We have already seen the \fB\-label\fR
3401 option that sets the entry's text label.   The \fBentry configure\fR
3402 operation lets you set or modify an entry's configuration options.
3403 .CS
3404 \&.t entry configure $id -color red -font fixed
3405 .CE
3406 You can hide an entry and its children using the \fB\-hide\fR option.
3407 .CS
3408 \&.t entry configure $id -hide yes
3409 .CE
3410 More that one entry can be configured at once.  All entries specified
3411 are configured with the same options.
3412 .CS
3413 \&.t entry configure $i1 $i2 $i3 $i4 -color brown 
3414 # or ...
3415 \&.t entry configure [list $i1 $i2 $i3 $i4] -color brown 
3416 .CE
3417 An icon is displayed for each entry.  It's a Tk image drawn to the
3418 left of the label.  You can set the icon with the entry's
3419 \fB\-icons\fR option.  It takes a list of two image names: one to
3420 represent the open entry, another when it is closed.
3421 .CS
3422 set im1 [image create photo -file openfolder.gif]
3423 set im2 [image create photo -file closefolder.gif]
3424 \&.t entry configure $id -icons "$im1 $im2"
3425 .CE
3426 If \fB\-icons\fR is set to the empty string, no icons are display.
3427 .PP
3428 If an entry has children, a button is displayed to the left of the
3429 icon. Clicking the mouse on this button opens or closes the
3430 sub-hierarchy.  The button is normally a \fB+\fR or \fB\-\fR
3431 symbol, but can be configured in a variety of ways using the \fBbutton
3432 configure\fR operation.  For example, the \fB+\fR and \fB\-\fR
3433 symbols can be replaced with Tk images.
3434 .CS
3435 set im1 [image create photo -file closefolder.gif]
3436 set im2 [image create photo -file downarrow.gif]
3437 \&.t button configure $id -images "$im1 $im2" \\
3438     -openrelief raised -closerelief raised
3439 .CE
3440 Entries can contain an arbitrary number of \fIdata fields\fR.  Data
3441 fields are name-value pairs.  Both the value and name are strings.
3442 The entry's \fB\-data\fR option lets you set data fields.
3443 .CS
3444 \&.t entry configure $id -data {mode 0666 group users}
3445 .CE
3446 The \fB\-data\fR takes a list of name-value pairs.  
3447 .PP
3448 You can display these data fields as \fIcolumns\fR in the
3449 \fBtreeview\fR widget.  You can create and configure columns with
3450 the \fBcolumn\fR operation.  For example, to add a new column to the
3451 widget, use the \fBcolumn insert\fR operation.  The last argument is
3452 the name of the data field that you want to display.
3453 .CS
3454 \&.t column insert end "mode"
3455 .CE
3456 The column title is displayed at the top of the column.  By default,
3457 it's is the field name.  You can override this using the column's
3458 \fB\-title\fR option.
3459 .CS
3460 \&.t column insert end "mode" -title "File Permissions"
3461 .CE
3462 Columns have several configuration options.  The \fBcolumn
3463 configure\fR operation lets you query or modify column options.
3464 .CS
3465 \&.t column configure "mode" -justify left
3466 .CE
3467 The \fB\-justify\fR option says how the data is justified within in
3468 the column.  The \fB\-hide\fR option indicates whether the column is
3469 displayed.
3470 .CS
3471 \&.t column configure "mode" -hide yes
3472 .CE
3473 Entries can be selected by clicking on the mouse.  Selected entries
3474 are drawn using the colors specified by the \fB\-selectforeground\fR 
3475 and \fB\-selectbackground\fR configuration options.
3476 The selection itself is managed by the \fBselection\fR operation.
3477 .CS
3478 # Clear all selections
3479 \&.t selection clear 0 end
3480 # Select the root node
3481 \&.t selection set 0 
3482 .CE
3483 The \fBcurselection\fR operation returns a list of ids of
3484 all the selected entries.
3485 .CS
3486 set ids [\&.t curselection]
3487 .CE
3488 You can use the \fBget\fR operation to convert the ids to 
3489 their pathnames.
3490 .CS
3491 set names [eval .t get -full $ids]
3492 .CE
3493 If a treeview is exporting its selection (using the
3494 \fB\-exportselection\fR option), then it will observe the standard X11
3495 protocols for handling the selection.  Treeview selections are
3496 available as type \fBSTRING\fR; the value of the selection will be the
3497 pathnames of the selected entries, separated by newlines.
3498 .PP
3499 The \fBtreeview\fR supports two modes of selection: \fBsingle\fR
3500 and \fBmultiple\fR.  In single select mode, only one entry can be
3501 selected at a time, while multiple select mode allows several entries
3502 to be selected.  The mode is set by the widget's \fB\-selectmode\fR
3503 option.
3504 .CS
3505 \&.t configure -selectmode "multiple"
3506 .CE
3507 You can be notified when the list of selected entries changes.  The widget's
3508 \fB\-selectcommand\fR specifies a Tcl procedure that is called whenever
3509 the selection changes.
3510 .CS
3511 proc SelectNotify { widget } {
3512    set ids [\&$widget curselection]
3513 }
3514 \&.t configure -selectcommand "SelectNotify .t"
3515 .CE
3516 The widget supports the standard Tk scrolling and scanning operations.
3517 The \fBtreeview\fR can be both horizontally and vertically. You can
3518 attach scrollbars to the \fBtreeview\fR the same way as the listbox
3519 or canvas widgets.
3520 .CS
3521 scrollbar .xbar -orient horizontal -command ".t xview"
3522 scrollbar .ybar -orient vertical -command ".t yview"
3523 \&.t configure -xscrollcommand ".xbar set" \\
3524     -yscrollcommand ".ybar set"
3525 .CE
3526 Entries can be programmatically opened or closed using the \fBopen\fR
3527 and \fBclose\fR operations respectively.  
3528 .CS
3529 \&.t open $id
3530 \&.t close $id
3531 .CE
3532 When an entry is opened, a Tcl procedure can be automatically invoked.
3533 The \fB\-opencommand\fR option specifies this procedure.  This
3534 procedure can lazily insert entries as needed.
3535 .CS
3536 proc AddEntries { dir } {
3537    eval .t insert end [glob -nocomplain $dir/*] 
3538 }
3539 \&.t configure -opencommand "AddEntries %P"
3540 .CE
3541 Now when an entry is opened, the procedure \fBAddEntries\fR is
3542 called and adds children to the entry.  Before the command is invoked,
3543 special "%" substitutions (like \fBbind\fR) are performed. Above,
3544 \fB%P\fR is translated to the pathname of the entry.
3545 .PP
3546 The same feature exists when an entry is closed.  The
3547 \fB\-closecommand\fR option specifies the procedure.
3548 .CS
3549 proc DeleteEntries { id } {
3550    .t entry delete $id 0 end
3551 }
3552 \&.t configure -closecommand "DeleteEntries %#"
3553 .CE
3554 When an entry is closed, the procedure \fBDeleteEntries\fR is called
3555 and deletes the entry's children using the \fBentry delete\fR operation
3556 (\fB%#\fR is the id of entry).
3557 .SH OLD TREEVIEW EDITS
3558 \fBNOTE: This section is OBSOLETE.  Native Tk widgets are now used for editing.\fR.
3559 .TP
3560 When editing the subwidget .edit is available.
3561 .TP
3562 \fIpathName.\fBedit \fIoperation\fR ?\fIargs\fR?
3563 This operation is used to provide text editing for cells (data 
3564 fields in a column) or entry labels.
3565 It has several forms, depending on \fIoperation\fR:
3566 .RS
3567 .TP
3568 \fIpathName.\fBedit apply\fR
3569 Applies the edited buffer, replacing the entry label
3570 or data field. The edit window is hidden.
3571 .TP
3572 \fIpathName.\fBedit cancel\fR
3573 Cancels the editing operation, reverting the entry label 
3574 or data value back to the previous value. The edit window is hidden.
3575 .TP
3576 \fIpathName.\fBedit cget\fI value\fR
3577 Returns the current value of the configuration option given
3578 by \fIoption\fR.
3579 \fIOption\fR may have any of the values accepted by the \fBconfigure\fR
3580 operation described below.
3581 .TP
3582 \fIpathName.\fBedit configure\fR ?\fIoption value\fR?
3583 Query or modify the configuration options of the edit window.
3584 If no \fIoption\fR is specified, returns a list describing all of
3585 the available options (see \fBTk_ConfigureInfo\fR for
3586 information on the format of this list).  If \fIoption\fR is specified
3587 with no \fIvalue\fR, then the command returns a list describing the
3588 one named option (this list will be identical to the corresponding
3589 sublist of the value returned if no \fIoption\fR is specified).  If
3590 one or more \fIoption\-value\fR pairs are specified, then the command
3591 modifies the given widget option(s) to have the given value(s);  in
3592 this case the command returns an empty string.
3593 \fIOption\fR and \fIvalue\fR are described in the section 
3594 .SB "TEXT EDITING OPTIONS" 
3595 below.
3596 .RE
3597 .TP
3598 \fIpathName.\fBedit delete\fI first last\fR
3599 Deletes the characters in the edit buffer between the two given
3600 character positions.  
3601 .TP
3602 \fIpathName.\fBedit get\fR ?\fI\-root\fR? \fIx y\fR
3603 .TP
3604 \fIpathName.\fBedit icursor\fI index\fR
3605 .TP
3606 \fIpathName.\fBedit index\fI index\fR
3607 Returns the text index of given \fIindex\fR.
3608 .TP
3609 \fIpathName.\fBedit insert\fI index string\fR
3610 Insert the text string \fIstring\fR into the edit buffer at the index 
3611 \fIindex\fR.  For example, the index 0 will prepend the buffer.
3612 .TP
3613 \fIpathName.\fBedit selection\fI args\fR
3614 This operation controls the selection of the editing window.  Note
3615 that this differs from the selection of entries.
3616 It has the following forms:
3617 .RS
3618 .TP
3619 \fIpathName.\fBedit selection adjust\fI index\fR
3620 Adjusts either the first or last index of the selection.
3621 .TP
3622 \fIpathName.\fBedit selection clear\fR
3623 Clears the selection.
3624 .TP
3625 \fIpathName.\fBedit selection from\fI index\fR
3626 Sets the anchor of the selection.
3627 .TP
3628 \fIpathName.\fBedit selection present\fR
3629 Indicates if a selection is present.
3630 .TP
3631 \fIpathName.\fBedit selection range\fI start end\fR
3632 Sets both the anchor and mark of the selection.
3633 .TP
3634 \fIpathName.\fBedit selection to\fI index\fR
3635 Sets the unanchored end (mark) of the selection.
3636 .RE
3637 .SH "LABEL ISSUES"
3638 Entries take a \fB-label\fR option that can be used to
3639 specify the text to display.
3640 This is not the same thing as the node label.
3641 .PP
3642 By default labels are checked for duplicates by \fBinsert\fR,
3643 which can slow down large (10k+) inserts.
3644 Setting \fB-allowduplicates\fR to 1 disables this checking.
3645 .PP
3646 An entries label can be changed either by 
3647 by setting \fB-allowduplicates\fR to 1 and using treeviews \fBentry relabel\fR
3648 or by using trees \fBlabel\fR command.
3649 .PP
3650 Instead of lists, a separator can be specified with \fB-separator\fR.
3651 Thus for managing files we might use:
3652 .PP
3653 .CS
3654  treeview .t -separator / -autocreate 1
3655  .t insert end  mann/text.n mann/canvas.n
3656  .t insert end  Help Search Close -at root->mann->text.n
3657  pack .t
3658 .SH "NOTES"
3659 Text cells in display height can be at most 64K pixels high per row.
3660 .SH KEYWORDS
3661 treeview, widget