OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [man/] [HList.html] - Blame information for rev 1782

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
 
2
 
3
 
4
<TITLE>tixHList - Create and manipulate Tix Hierarchial List widgets</TITLE>
5
<Center><H2>tixHList - Create and manipulate Tix Hierarchial List widgets</H2></Center><hr>
6
 
7
</pre><H3>SYNOPSIS</H3>
8
<B>tixHList<I> <I>pathName ?<I>options</I></B>?
9
<P>
10
</pre><H3>SUPER-CLASS</H3>
11
None.
12
</pre><H3>STANDARD OPTIONS</H3>
13
<P>
14
<pre><code><code><code>
15
<B>background</B></I>   <B>borderWidth</B></I>  <B>cursor</B></I>       <B>foreground</B></I>
16
<B>font</B></I> <B>height</B></I>       <B>highlightColor <B>highlightThickness
17
<B>relief</B></I>       <B>selectBackground</B></I>     <B>selectForeground</B></I>
18
<B>xScrollCommand</B></I>       <B>yScrollCommand</B></I>       <B>width</B></I>
19
</code></code></code></pre>
20
<P>
21
See the <B>options(n)</B></I> manual entry for details on the standard options.
22
</pre><H3>WIDGET-SPECIFIC OPTIONS</H3>
23
<P>
24
<pre><code><code><code>
25
Name:           <B>browsecmd</B></I>
26
Class:          <B>BrowseCmd</B></I>
27
Switch:         <B>-browsecmd</B></I>
28
</code></code></code></pre>
29
<UL>
30
Specifies a TCL command to be executed when the user browses through the
31
entries in the HList widget.
32
</UL>
33
<P>
34
<pre><code><code><code>
35
Name:           <B>columns</B></I>
36
Class:          <B>Columns</B></I>
37
Switch:         <B>-columns</B></I>
38
</code></code></code></pre>
39
<UL>
40
Specifies the number of columns in this HList widget. This option can
41
only be set during the creation of the HList widget and cannot be
42
changed subsequently.
43
</UL>
44
<P>
45
<pre><code><code><code>
46
Name:           <B>command</B></I>
47
Class:          <B>Command</B></I>
48
Switch:         <B>-command</B></I>
49
</code></code></code></pre>
50
<UL>
51
Specifies the TCL command to be executed when the user invokes a list
52
entry in the HList widget. Normally the user invokes a list
53
entry by double-clicking it or pressing the Return key.
54
</UL>
55
<P>
56
<pre><code><code><code>
57
Name:           <B>drawBranch</B></I>
58
Class:          <B>DrawBranch</B></I>
59
Switch:         <B>-drawbranch</B></I>
60
</code></code></code></pre>
61
<UL>
62
A Boolean value to specify whether branch line should be drawn to
63
connect list entries to their parents.
64
</UL>
65
<P>
66
<pre><code><code><code>
67
Name:           <B>foreground</B></I>
68
Class:          <B>Foreground</B></I>
69
Switch:         <B>-foreground</B></I>
70
Alias:          <B>-fg</B></I>
71
</code></code></code></pre>
72
<UL>
73
<B>[OBSOLETE]</B></I> Specifies the default foreground color for the list entries.
74
</UL>
75
<P>
76
<pre><code><code><code>
77
Name:           <B>gap</B></I>
78
Class:          <B>Gap</B></I>
79
Switch:         <B>-gap</B></I>
80
</code></code></code></pre>
81
<UL>
82
<B>[OBSOLETE]</B></I> The default distance between the bitmap/image and the
83
text in list entries.
84
</UL>
85
<P>
86
<pre><code><code><code>
87
Name:           <B>header</B></I>
88
Class:          <B>Header</B></I>
89
Switch:         <B>-header</B></I>
90
</code></code></code></pre>
91
<UL>
92
A Boolean value specifying whether headers should be displayed for
93
this HList widget (see the <B>header</B></I> widget command below).
94
</UL>
95
<P>
96
<pre><code><code><code>
97
Name:           <B>height</B></I>
98
Class:          <B>Height</B></I>
99
Switch:         <B>-height</B></I>
100
</code></code></code></pre>
101
<UL>
102
Specifies the desired height for the window in number of characters.
103
</UL>
104
<P>
105
<pre><code><code><code>
106
Name:           <B>indent</B></I>
107
Class:          <B>Indent</B></I>
108
Switch:         <B>-indent</B></I>
109
</code></code></code></pre>
110
<UL>
111
Specifies the amount of horizontal indentation between a list entry
112
and its children. Must be a valid screen distance value.
113
</UL>
114
<P>
115
<pre><code><code><code>
116
Name:           <B>indicator</B></I>
117
Class:          <B>Indicator</B></I>
118
Switch:         <B>-indicator</B></I>
119
</code></code></code></pre>
120
<UL>
121
Specifies whether the indicators should be displayed inside the HList
122
widget. See the <B>indicator</B></I> widget command below.
123
</UL>
124
<P>
125
<pre><code><code><code>
126
Name:           <B>indicatorCmd</B></I>
127
Class:          <B>IndicatorCmd</B></I>
128
Switch:         <B>-indicatorcmd</B></I>
129
</code></code></code></pre>
130
<UL>
131
Specifies a TCL command to be executed when the user manipulates the
132
indicator of an HList entry. The <B>-indicatorcmd</B></I> is triggered
133
when the user press or releases the mouse button over the indicator in
134
an HList entry. By default the TCL command specified by
135
<B>-indicatorcmd</B></I> is executed with one additional argument, the
136
entryPath of the entry whose indicator has been triggered. Additional
137
information about the event can be obtained by the <B>tixEvent</B></I>
138
command.
139
</UL>
140
<P>
141
<pre><code><code><code>
142
Name:           <B>itemType</B></I>
143
Class:          <B>ItemType</B></I>
144
Switch:         <B>-itemtype</B></I>
145
</code></code></code></pre>
146
<UL>
147
Specifies the default type of display item for this HList widget. When
148
you call the add and addchild widget commands, display items of this
149
type will be created if the <B>-itemtype</B></I> option is not specified .
150
</UL>
151
<P>
152
<pre><code><code><code>
153
Name:           <B>padX</B></I>
154
Class:          <B>Pad</B></I>
155
Switch:         <B>-padx</B></I>
156
</code></code></code></pre>
157
<UL>
158
<B>[OBSOLETE]</B></I> The default horizontal padding for list entries.
159
</UL>
160
<P>
161
<pre><code><code><code>
162
Name:           <B>padY</B></I>
163
Class:          <B>Pad</B></I>
164
Switch:         <B>-padx</B></I>
165
</code></code></code></pre>
166
<UL>
167
<B>[OBSOLETE]</B></I> The default vertical padding for list entries.
168
</UL>
169
<P>
170
<pre><code><code><code>
171
Name:           <B>selectBackground</B></I>
172
Class:          <B>SelectBackground</B></I>
173
Switch:         <B>-selectbackground</B></I>
174
</code></code></code></pre>
175
<UL>
176
Specifies the background color for the selected list entries.
177
</UL>
178
<P>
179
<pre><code><code><code>
180
Name:           <B>selectBorderWidth</B></I>
181
Class:          <B>BorderWidth</B></I>
182
Switch:         <B>-selectborderwidth</B></I>
183
</code></code></code></pre>
184
<UL>
185
Specifies a non-negative value indicating the width of the 3-D border
186
to draw around selected items.  The value may have any of the forms
187
acceptable to <B>Tk_GetPixels</B></I>.
188
</UL>
189
<P>
190
<pre><code><code><code>
191
Name:           <B>selectForeground</B></I>
192
Class:          <B>SelectForeground</B></I>
193
Switch:         <B>-selectforeground</B></I>
194
</code></code></code></pre>
195
<UL>
196
Specifies the foreground color for the selected list entries.
197
</UL>
198
<P>
199
<pre><code><code><code>
200
Name:           <B>selectMode</B></I>
201
Class:          <B>SelectMode</B></I>
202
Switch:         <B>-selectmode</B></I>
203
</code></code></code></pre>
204
<UL>
205
Specifies one of several styles for manipulating the selection.  The
206
value of the option may be arbitrary, but the default bindings expect
207
it to be either <B>single</B></I>, <B>browse</B></I>, <B>multiple</B></I>, or
208
<B>extended</B></I>; the default value is <B>single</B></I>.
209
</UL>
210
<P>
211
<pre><code><code><code>
212
Name:           <B>sizeCmd</B></I>
213
Class:          <B>SizeCmd</B></I>
214
Switch:         <B>-sizecmd</B></I>
215
</code></code></code></pre>
216
<UL>
217
Specifies a TCL script to be called whenever the HList widget
218
changes its size. This command can be useful to implement "user scroll
219
bars when needed" features.
220
</UL>
221
<P>
222
<pre><code><code><code>
223
Name:           <B>separator</B></I>
224
Class:          <B>Separator</B></I>
225
Switch:         <B>-separator</B></I>
226
</code></code></code></pre>
227
<UL>
228
Specifies the character to used as the separator character when
229
intepreting the path-names of list entries. By default the character
230
"." is used.
231
</UL>
232
<P>
233
<pre><code><code><code>
234
Name:           <B>width</B></I>
235
Class:          <B>Width</B></I>
236
Switch:         <B>-width</B></I>
237
</code></code></code></pre>
238
<UL>
239
Specifies the desired width for the window in characters.
240
</UL>
241
</pre><HR>
242
</pre><H3>DESCRIPTION</H3>
243
<P>
244
The <B>tixHList</B></I> command creates a new window (given by the
245
<I>pathName</I></B> argument) and makes it into a HList widget.
246
Additional options, described above, may be specified on the command
247
line or in the option database to configure aspects of the
248
HList widget such as its cursor and relief.
249
<P>
250
The HList widget can be used to display any data that have a
251
hierarchical structure, for example, file system directory trees. The
252
list entries are indented and connected by branch lines according to
253
their places in the hierachy.
254
<P>
255
Each list entry is identified by an <B>entryPath</B></I>. The entryPath is a
256
sequence of <B>entry names</B></I> separated by the separator charactor
257
(specified by the <B>-separator</B></I> option). An <B>entry name</B></I> can be
258
any string that does not contain the separator charactor, or it can be
259
the a string that contains only one separator charactor.
260
<P>
261
For example, when "." is used as the separator charactor,
262
"one.two.three" is the entryPath for a list entry whose parent is
263
"one.two", whose parent is "one", which is a toplevel entry (has no
264
parents).
265
<P>
266
Another examples: ".two.three" is the entryPath for a list entry whose
267
parent is ".two", whose parent is ".", which is a toplevel entry.
268
</pre><H3>DISPLAY ITEMS</H3>
269
<P>
270
Each list entry in an HList widget is associated with a <B>display
271
item</B></I>.  The display item determines what visual information should
272
be displayed for this list entry. Please see the <B>DItem(n)</B></I> manual
273
page for a list of all display items.
274
 
275
When a list entry is created by the <B>add</B></I> or <B>addchild</B></I> widget
276
commands, the type of its display item is determined by the
277
<B>-itemtype</B></I> option passed to these commands. If the
278
<B>-itemtype</B></I> is omitted, then by default the type specified by
279
</pre><H3>WIDGET COMMAND</H3>
280
<P>
281
The <B>tixHList</B></I> command creates a new Tcl command whose name is the
282
may be used to invoke various operations on the widget.  It has the
283
following general form:
284
<pre>
285
<I>pathName option </I></B>?<I>arg arg ...</I></B>?
286
<P>
287
</pre>
288
<I>PathName</I></B> is the name of the command, which is the same as
289
determine the exact behavior of the command.  The following
290
commands are possible for HList widgets:
291
<DL>
292
<DT> <I>pathName <B>add<I> entryPath </I></B>?<I>option value ...</I></B>?
293
</I></B>
294
<DD> Creates a new list entry with the pathname <I>entryPath</I></B>. A list
295
entry must be created after its parent is created (unless this entry
296
is a top-level entry, which has no parent). This command returns the
297
entryPath of the newly created list entry. The following
298
configuration options can be given to configure the list entry:
299
</DL>
300
<UL>
301
<DL>
302
<DT> <B>-at<I> position</I></B>
303
</I></B>
304
<DD> Insert the new list at the position given by <I>position</I></B>.
305
<I>position</I></B> must be a valid integer. the Position <B>0</B></I> indicates
306
the first position, <B>1</B></I> indicates the second position, and so on.
307
</DL>
308
<DL>
309
<DT> <B>-after<I> afterWhich</I></B>
310
</I></B>
311
<DD> Insert the new list entry after the entry identified by
312
<I>afterWhich</I></B>. <I>afterWhich</I></B> must be a valid list entry and it
313
mush have the same parent as the new list entry
314
</DL>
315
<DL>
316
<DT> <B>-before<I> beforeWhich</I></B>
317
</I></B>
318
<DD> Insert the new list entry before the entry identified by
319
<I>beforeWhich</I></B>. <I>beforeWhich</I></B> must be a valid list entry and it
320
mush have the same parent as the new list entry
321
</DL>
322
<DL>
323
<DT> <B>-data<I> string</I></B>
324
</I></B>
325
<DD> Specifies a string to associate with this list entry. This string can
326
be queried by the <B>info</B></I> widget command. The application
327
programmer can use the <B>-data</B></I> option to associate the list entry
328
with the data it represents.
329
</DL>
330
<DL>
331
<DT> <B>-itemtype<I> type</I></B>
332
</I></B>
333
<DD> Specifies the type of display item to be display for the new list
334
entry. <B>type</B></I> must be a valid display item type. Currently the
335
available display item types are <B>imagetext</B></I>, <B>text</B></I>, and
336
<B>window</B></I>. If this option is not specified, then by default the
337
</DL>
338
<DL>
339
<DT> <B>-state</B></I>
340
</I></B>
341
<DD> Specifies whether this entry can be selected or invoked by the user.
342
Must be either <B>normal</B></I> or <B>disabled</B></I>.
343
</DL>
344
</UL>
345
The <B>add</B></I> widget command accepts additional configuration options
346
to configure the display item associated with this list entry. The set
347
of additional configuration options depends on the type of the display
348
item given by the <B>-itemtype</B></I> option. Please see the
349
<B>DItem(n)</B></I> manual page for a list of the configuration options for
350
each of the display item types.
351
<DL>
352
<DT> <I>pathName <B>addchild<I> parentPath </I></B>?<I>option value ... </I></B>?
353
</I></B>
354
<DD> Adds a new child entry to the children list of the list entry
355
identified by <I>parentPath</I></B>. Or, if <I>parentPath</I></B> is set to be
356
the empty string, then creates a new toplevel entry. The name of the
357
new list entry will be a unique name automatically generated by the
358
HList widget. Usually if <I>parentPath</I></B> is <B>foo</B></I>, then the
359
entryPath of the new entry will be <B>foo.1</B></I>, <B>foo.2</B></I>, ... etc.
360
This command returns the entryPath of the newly created list entry.
361
<I>option</I></B> can be any option for the <B>add</B></I> widget command.
362
</DL>
363
<DL>
364
<DT> <I>pathName <B>anchor set <I>entryPath</I></B>
365
</I></B>
366
<DD> Sets the anchor to the list entry identified by <I>entryPath</I></B>.  The
367
anchor is the end of the selection that is fixed while the user is
368
dragging out a selection with the mouse.
369
</DL>
370
<DL>
371
<DT> <I>pathName <B>anchor clear</B></I>
372
</I></B>
373
<DD> Removes the anchor, if any, from this HList widget. This only
374
removes the surrounding highlights of the anchor entry and does not
375
affect its selection status.
376
</DL>
377
<DL>
378
<DT> <I>pathName <B>cget</B></I> <I>option</I></B>
379
</I></B>
380
<DD> Returns the current value of the configuration option given by
381
<I>option</I></B>. <I>Option</I></B> may have any of the values accepted by the
382
<B>tixHList</B></I> command.
383
</DL>
384
<DL>
385
<DT> <I>pathName <B>column width <I>col</I></B> ?<I>-char</I></B>? ?<I>width</I></B>?
386
</I></B>
387
<DD> Querys or sets the width of a the column <I>col</I></B> in the HList
388
widget. The value of <I>col</I></B> is zero-based: 0 stands for the first
389
column, 1 stands for the second, and so on. If no further parameters
390
are given, returns the current width of this column (in number of
391
pixels). Additional parameters can be given to set the width of this
392
column:
393
</DL>
394
<P>
395
<UL>
396
<DL>
397
<DT> <I>pathName <B>column width <I>col</I></B> <B>{}</B></I>
398
</I></B>
399
<DD> An empty string indicates that the width of the column should be just
400
wide enough to display the widest element in this column. In this
401
case, the width of this column may change as a result of the elements
402
in this column changing their sizes.
403
</DL>
404
<DL>
405
<DT> <I>pathName <B>column width <I>col</I></B> <I>width</I></B>
406
</I></B>
407
<DD> <I>width</I></B> must be in a form accepted by <B>Tk_GetPixels(3)</B></I>.
408
</DL>
409
<DL>
410
<DT> <I>pathName <B>column width <I>col</I></B> <B>-char</B></I> <I>nChars</I></B>
411
</I></B>
412
<DD> The width is set to be the average width occupied by <I>nChars</I></B>
413
number of characters of the font specified by the <B>-font</B></I> option
414
of this HList widget.
415
</DL>
416
</UL>
417
<DL>
418
<DT> <I>pathName <B>configure</B></I> ?<I>option</I></B>? <I>?value option value ...</I></B>?
419
</I></B>
420
<DD> Query or modify the configuration options of the widget.  If no
421
<I>option</I></B> is specified, returns a list describing all of the
422
available options for <I>pathName</I></B> (see <B>Tk_ConfigureInfo</B></I> for
423
information on the format of this list). If <I>option</I></B> is specified
424
with no <I>value</I></B>, then the command returns a list describing the
425
one named option (this list will be identical to the corresponding
426
sublist of the value returned if no <I>option</I></B> is specified).  If
427
one or more <I>option-value</I></B> pairs are specified, then the command
428
modifies the given widget option(s) to have the given value(s); in
429
this case the command returns an empty string.  <I>Option</I></B> may have
430
any of the values accepted by the <B>tixHList</B></I> command.
431
</DL>
432
<DL>
433
<DT> <I>pathName <B>delete</B></I> <I>option</I></B> ?<I>entryPath</I></B>?
434
</I></B>
435
<DD> Delete one or more list entries. <I>option</I></B> may be one of the
436
following:
437
</DL>
438
<UL>
439
<DL>
440
<DT> <B>all</B></I>
441
</I></B>
442
<DD> Delete all entries in the HList. In this case the <I>entryPath</I></B>
443
does not need to be specified.
444
</DL>
445
<DL>
446
<DT> <B>entry</B></I>
447
</I></B>
448
<DD> Delete the entry specified by <I>entryPath</I></B> and all its offsprings,
449
if any.
450
</DL>
451
<DL>
452
<DT> <B>offsprings</B></I>
453
</I></B>
454
<DD> Delete all the offsprings, if any, of the entry specified by
455
<I>entryPath</I></B>. However, <I>entryPath</I></B> itself is not deleted.
456
</DL>
457
<DL>
458
<DT> <B>siblings</B></I>
459
</I></B>
460
<DD> Delete all the list entries that share the same parent with the entry
461
specified by <I>entryPath</I></B>. However, <I>entryPath</I></B> itself is not
462
deleted.
463
</DL>
464
</UL>
465
<DL>
466
<DT> <I>pathName <B>dragsite set <I>entryPath</I></B>
467
</I></B>
468
<DD> Sets the dragsite to the list entry identified by
469
<I>entryPath</I></B>. The dragsite is used to indicate the source of a
470
drag-and-drop action. Currently drag-and-drop functionality has not
471
been implemented in Tix yet.
472
</DL>
473
<DL>
474
<DT> <I>pathName <B>dragsite clear</B></I>
475
</I></B>
476
<DD> Remove the dragsite, if any, from the this HList widget. This only
477
removes the surrounding highlights of the dragsite entry and does not
478
affect its selection status.
479
</DL>
480
<DL>
481
<DT> <I>pathName <B>dropsite set <I>entryPath</I></B>
482
</I></B>
483
<DD> Sets the dropsite to the list entry identified by <I>entryPath</I></B>. The
484
dropsite is used to indicate the target of a grag-and-drop
485
action. Currently drag-and-drop functionality has not been implemented
486
in Tix yet.
487
</DL>
488
<DL>
489
<DT> <I>pathName <B>dropsite clear</B></I>
490
</I></B>
491
<DD> Remove the dropsite, if any, from the this HList widget. This only
492
removes the surrounding highlights of the dropsite entry and does not
493
affect its selection status.
494
</DL>
495
<DL>
496
<DT> <I>pathName <B>entrycget</B></I> <I> entryPath option</I></B>
497
</I></B>
498
<DD> Returns the current value of the configuration option given by
499
<I>option</I></B> for the entry indentfied by <I>entryPath</I></B>. <I>Option</I></B>
500
may have any of the values accepted by the <B>add</B></I> widget command.
501
</DL>
502
<DL>
503
<DT> <I>pathName <B>entryconfigure<I> entryPath </I></B>?<I>option</I></B>? <I>?value option value ...</I></B>?
504
</I></B>
505
<DD> Query or modify the configuration options of the list entry indentfied
506
by <I>entryPath</I></B>. If no <I>option</I></B> is specified, returns a list
507
describing all of the available options for <I>entryPath</I></B> (see
508
<B>Tk_ConfigureInfo</B></I> for information on the format of this list.) If
509
<I>option</I></B> is specified with no <I>value</I></B>, then the command
510
returns a list describing the one named option (this list will be
511
identical to the corresponding sublist of the value returned if no
512
<I>option</I></B> is specified). If one or more <I>option-value</I></B> pairs
513
are specified, then the command modifies the given option(s) to have
514
the given value(s); in this case the command returns an empty string.
515
<I>Option</I></B> may have any of the values accepted by the <B>add</B></I> or
516
<B>addchild</B></I> widget command. The exact set of options depends on the
517
value of the <B>-itemtype</B></I> option passed to the the <B>add</B></I> or
518
<B>addchild</B></I> widget command when this list entry is created.
519
</DL>
520
<DL>
521
<DT> <I>pathName <B>header <I>option</I></B> <I>col</I></B> ?<I>args ...</I></B>?
522
</I></B>
523
<DD> Manipulates the header items of this HList widget. If the
524
<B>-header</B></I> option of this HList widget is set to true, then a
525
header item is displayed at the top of each column. The <I>col</I></B>
526
argument for this command must be a valid integer. 0 indicates the
527
first column, 1 the second column, ... and so on. This command
528
supports the following options:
529
</DL>
530
<UL>
531
<DL>
532
<DT> <I>pathName <B>header <B>cget</B></I> <I>col</I></B> <I>option</I></B>
533
</I></B>
534
<DD> If the <I>col</I></B>-th column has a header display item, returns the
535
value of the specified <I>option</I></B> of the header item. If the header
536
</DL>
537
<DL>
538
<DT> <I>pathName <B>header <B>configure</B></I> <I>col</I></B> ?<I>option</I></B>? <I>?value option value ...</I></B>?
539
</I></B>
540
<DD> Query or modify the configuration options of the header display item
541
of the <I>col</I></B>-th column. The header item must exist, or an error
542
will result.  If no <I>option</I></B> is specified, returns a list
543
describing all of the available options for the header display item
544
(see <B>Tk_ConfigureInfo(3)</B></I> for information on the format of this
545
list.) If <I>option</I></B> is specified with no <I>value</I></B>, then the
546
command returns a list describing the one named option (this list will
547
be identical to the corresponding sublist of the value returned if no
548
<I>option</I></B> is specified). If one or more <I>option-value</I></B> pairs
549
are specified, then the command modifies the given option(s) to have
550
the given value(s); in this case the command returns an empty
551
string. <I>Option</I></B> may have any of the values accepted by the
552
<B>header create</B></I> widget command. The exact set of options depends
553
on the value of the <B>-itemtype</B></I> option passed to the the <B>header
554
create</B></I> widget command when this display item was created.
555
</DL>
556
<DL>
557
<DT> <I>pathName <B>header <B>create</B></I> <I>col</I></B> ?<I>-itemtype type</I></B>? ?<I>option value ...</I></B>?
558
</I></B>
559
<DD> Creates a new display item as the header for the <I>col</I></B>-th
560
column. If an header display item already exists for this column, it
561
will be replaced by the new item.  An optional parameter
562
<I>-itemtype</I></B> can be used to specify what type of display item
563
should be created. If the <I>-itemtype</I></B> is not given, then by
564
option is used. Additional parameters, in <I>option-value</I></B> pairs,
565
can be passed to configure the appearance of the display item. Each
566
<I>option-value</I></B> pair must be a valid option for this type of
567
display item or one of the following:
568
</DL>
569
<UL>
570
<DL>
571
<DT> <B>-borderwidth</B></I>
572
</I></B>
573
<DD> Specifies the border width of this header item.
574
</DL>
575
<DL>
576
<DT> <B>-headerbackground</B></I>
577
</I></B>
578
<DD> Specifies the background color of this header item.
579
</DL>
580
<DL>
581
<DT> <B>-relief</B></I>
582
</I></B>
583
<DD> Specifies the relief type of the border of this header item.
584
</DL>
585
</UL>
586
<DL>
587
<DT> <I>pathName <B>header <B>delete <I>col</I></B>
588
</I></B>
589
<DD> Deletes the header display item for the <I>col</I></B>-th column.
590
</DL>
591
<DL>
592
<DT> <I>pathName <B>header <B>exists <I>col</I></B>
593
</I></B>
594
<DD> Return true if an header display item exists for the <I>col</I></B>-th
595
column; return false otherwise.
596
</DL>
597
<DL>
598
<DT> <I>pathName <B>header <B>size <I>entryPath</I></B>
599
</I></B>
600
<DD> If an header display item exists for the <I>col</I></B>-th column , returns
601
its size in a two element list of the form {<I>width height</I></B>};
602
returns an error if the header display item does not exist.
603
</DL>
604
</UL>
605
<DL>
606
<DT> <I>pathName <B>hide <I>option ?entryPath?</I></B>
607
</I></B>
608
<DD> Makes some of entries invisible invisible without deleting them.
609
<I>Option</I></B> can be one of the following:
610
</DL>
611
<UL>
612
<DL>
613
<DT> <B>entry</B></I>
614
</I></B>
615
<DD> Hides the list entry identified by <I>entryPath</I></B>.
616
</DL>
617
<P>
618
Currently only the <B>entry</B></I> option is supported. Other options will
619
be added in the next release.
620
</UL>
621
<DL>
622
<DT> <I>pathName <B>indicator <I>option</I></B> entryPath ?<I>args ...</I></B>?
623
</I></B>
624
<DD> Manipulates the indicator on the list entries. An indicator is usually
625
a small display item (such as an image) that is displayed to the left
626
to an entry to indicate the status of the entry. For example, it may
627
be used to indicator whether a directory is opened or
628
closed. <I>option</I></B> can be one of the following:
629
</DL>
630
<UL>
631
<DL>
632
<DT> <I>pathName <B>indicator <B>cget</B></I> <I>entryPath</I></B> <I>option</I></B>
633
</I></B>
634
<DD> If the list entry given by <I>entryPath</I></B> has an indicator, returns
635
the value of the specified <I>option</I></B> of the indicator. If the
636
</DL>
637
<DL>
638
<DT> <I>pathName <B>indicator <B>configure</B></I> <I>entryPath</I></B> ?<I>option</I></B>? <I>?value option value ...</I></B>?
639
</I></B>
640
<DD> Query or modify the configuration options of the indicator display
641
item of the entry specified by <I>entryPath</I></B>. The indicator item
642
must exist, or an error will result.  If no <I>option</I></B> is specified,
643
returns a list describing all of the available options for the
644
indicator display item (see <B>Tk_ConfigureInfo(3)</B></I> for information
645
on the format of this list). If <I>option</I></B> is specified with no
646
<I>value</I></B>, then the command returns a list describing the one named
647
option (this list will be identical to the corresponding sublist of
648
the value returned if no <I>option</I></B> is specified). If one or more
649
<I>option-value</I></B> pairs are specified, then the command modifies the
650
given option(s) to have the given value(s); in this case the command
651
returns an empty string.  <I>Option</I></B> may have any of the values
652
accepted by the <B>indicator create</B></I> widget command. The exact set
653
of options depends on the value of the <B>-itemtype</B></I> option passed
654
to the the <B>indicator create</B></I> widget command when this display item
655
was created.
656
</DL>
657
<DL>
658
<DT> <I>pathName <B>indicator <B>create</B></I> <I>entryPath</I></B> ?<I>-itemtype type</I></B>? ?<I>option value ...</I></B>?
659
</I></B>
660
<DD> Creates a new display item as the indicator for the entry specified by
661
<I>entryPath</I></B>. If an indicator display item already exists for this
662
entry, it will be replaced by the new item.  An optional parameter
663
<I>-itemtype</I></B> can be used to specify what type of display item
664
should be created. If the <I>-itemtype</I></B> is not given, then by
665
option is used. Additional parameters, in <I>option-value</I></B> pairs,
666
can be passed to configure the appearance of the display item. Each
667
<I>option-value</I></B> pair must be a valid option for this type of
668
display item.
669
</DL>
670
<DL>
671
<DT> <I>pathName <B>indicator <B>delete <I>entryPath</I></B>
672
</I></B>
673
<DD> Deletes the indicator display item for the entry given by <I>entryPath</I></B>.
674
</DL>
675
<DL>
676
<DT> <I>pathName <B>indicator <B>exists <I>entryPath</I></B>
677
</I></B>
678
<DD> Return true if an indicator display item exists for the entry given by
679
<I>entryPath</I></B>; return false otherwise.
680
</DL>
681
<DL>
682
<DT> <I>pathName <B>indicator <B>size <I>entryPath</I></B>
683
</I></B>
684
<DD> If an indicator display item exists for the entry given by
685
<I>entryPath</I></B>, returns its size in a two element list of the form
686
{<I>width height</I></B>}; returns an error if the indicator display item
687
does not exist.
688
</DL>
689
</UL>
690
<DL>
691
<DT> <I>pathName <B>info <I>option</I></B> <I>arg ...</I></B>
692
</I></B>
693
<DD> Query information about the HList widget. <I>option</I></B> can be one
694
of the following:
695
</DL>
696
<UL>
697
<DL>
698
<DT> <I>pathName <B>info <B>anchor</B></I>
699
</I></B>
700
<DD> Returns the entryPath of the current anchor, if any, of the HList
701
widget. If the anchor is not set, returns the empty string.
702
</DL>
703
<DL>
704
<DT> <I>pathName <B>info bbox</B></I> <I>entryPath</I></B>
705
</I></B>
706
<DD> Returns a list of four numbers describing the visible bounding box of
707
the entry given <I>entryPath</I></B>. The first two elements of the list
708
give the x and y coordinates of the upper-left corner of the screen
709
area covered by the entry (specified in pixels relative to the widget)
710
and the last two elements give the lower-right corner of the area, in
711
pixels. If no part of the entry given by index is visible on the
712
screen then the result is an empty string; if the entry is partially
713
visible, the result gives the only the visible area of the entry.
714
</DL>
715
<DL>
716
<DT> <I>pathName <B>info <B>children</B></I> ?<I>entryPath</I></B>?
717
</I></B>
718
<DD> children entries. Otherwise returns a list of the toplevel
719
</DL>
720
<DL>
721
<DT> <I>pathName <B>info <B>data</B></I> ?<I>entryPath</I></B>?
722
</I></B>
723
<DD> Returns the data associated with <I>entryPath</I></B>.
724
</DL>
725
<DL>
726
<DT> <I>pathName <B>info <B>dragsite</B></I>
727
</I></B>
728
<DD> Returns the entryPath of the current dragsite, if any, of the HList
729
widget. If the dragsite is not set, returns the empty string.
730
</DL>
731
<DL>
732
<DT> <I>pathName <B>info <B>dropsite</B></I>
733
</I></B>
734
<DD> Returns the entryPath of the current dropsite, if any, of the HList
735
widget. If the dropsite is not set, returns the empty string.
736
</DL>
737
<DL>
738
<DT> <I>pathName <B>info <B>exists</B></I> <I>entryPath</I></B>
739
</I></B>
740
<DD> Returns a boolean value indicating whether the list entry
741
<I>entrpyPath</I></B> exists.
742
</DL>
743
<DL>
744
<DT> <I>pathName <B>info <B>hidden</B></I> <I>entryPath</I></B>
745
</I></B>
746
<DD> Returns a boolean value indicating whether the list entry
747
<B>entrpyPath</B></I> is hidden or not.
748
</DL>
749
<DL>
750
<DT> <I>pathName <B>info <B>next</B></I> <I>entryPath</I></B>
751
</I></B>
752
<DD> Returns the entryPath of the list entry, if any, immediately below
753
this list entry. If this entry is already at the bottom of the HList
754
widget, returns an empty string.
755
</DL>
756
<DL>
757
<DT> <I>pathName <B>info <B>parent</B></I> <I>entryPath</I></B>
758
</I></B>
759
<DD> Returns the name of the parent of the list entry identified by
760
<I>entrpyPath</I></B>. If <I>entrpyPath</I></B> is a toplevel list entry,
761
returns the empty string.
762
</DL>
763
<DL>
764
<DT> <I>pathName <B>info <B>prev</B></I> <I>entryPath</I></B>
765
</I></B>
766
<DD> Returns the entryPath of the list entry, if any, immediately above
767
this list entry. If this entry is already at the top of the HList
768
widget, returns an empty string.
769
</DL>
770
<DL>
771
<DT> <I>pathName <B>info <B>selection</B></I>
772
</I></B>
773
<DD> Returns a list of selected entries in the HList widget. If no entries
774
are selectd, returns an empty string.
775
</DL>
776
</UL>
777
<DL>
778
<DT> <I>pathName <B>item <I>option</I></B> ?<I>args ...</I></B>?
779
</I></B>
780
<DD> Creates and configures the display items at individual columns the
781
entries. The form of additional of arguments depends on the choice of
782
<I>option</I></B>:
783
</DL>
784
<UL>
785
<DL>
786
<DT> <I>pathName <B>item <B>cget <I>entryPath col option</I></B>
787
</I></B>
788
<DD> Returns the current value of the configure <I>option</I></B> of the display
789
item at the column designated by <I>col</I></B> of the entry specified by
790
<I>entryPath</I></B>.
791
</DL>
792
<DL>
793
<DT> <I>pathName <B>item configure <I>entryPath col</I></B> ?<I>option</I></B>? <I>?value option value ...</I></B>?
794
</I></B>
795
<DD> Query or modify the configuration options of the display item at the
796
column designated by <I>col</I></B> of the entry specified by
797
<I>entryPath</I></B>. If no <I>option</I></B> is specified, returns a list
798
describing all of the available options for <I>entryPath</I></B> (see
799
<B>Tk_ConfigureInfo(3)</B></I> for information on the format of this
800
list). If <I>option</I></B> is specified with no <I>value</I></B>, then the
801
command returns a list describing the one named option (this list will
802
be identical to the corresponding sublist of the value returned if no
803
<I>option</I></B> is specified). If one or more <I>option-value</I></B> pairs
804
are specified, then the command modifies the given option(s) to have
805
the given value(s); in this case the command returns an empty string.
806
<I>Option</I></B> may have any of the values accepted by the <B>item
807
create</B></I> widget command. The exact set of options depends on the
808
value of the <B>-itemtype</B></I> option passed to the the <B>item
809
create</B></I> widget command when this display item was created.
810
</DL>
811
<DL>
812
<DT> <I>pathName <B>item create <I>entryPath col</I></B> ?<I>-itemtype type</I></B>? ?<I>option value ...</I></B>?
813
</I></B>
814
<DD> Creates a new display item at the column designated by <I>col</I></B> of
815
the entry specified by <I>entryPath</I></B>. An optional parameter
816
<I>-itemtype</I></B> can be used to specify what type of display items
817
should be created. If the <I>-itemtype</I></B> is not specified, then by
818
option is used.  Additional parameters, in <I>option-value</I></B> pairs,
819
can be passed to configure the appearance of the display item. Each
820
<I>option- value</I></B> pair must be a valid option for this type of
821
display item.
822
</DL>
823
<DL>
824
<DT> <I>pathName <B>item delete <I>entryPath col</I></B>
825
</I></B>
826
<DD> Deletes the display item at the column designated by <I>col</I></B> of
827
the entry specified by <I>entryPath</I></B>.
828
</DL>
829
<DL>
830
<DT> <I>pathName <B>item exists <I>entryPath col</I></B>
831
</I></B>
832
<DD> Returns true if there is a display item at the column designated by
833
<I>col</I></B> of the entry specified by <I>entryPath</I></B>; returns false
834
otherwise.
835
</DL>
836
</UL>
837
<DL>
838
<DT> <I>pathName <B>nearest <I>y</I></B>
839
</I></B>
840
<DD> Given a y-coordinate within the HList window, this command returns
841
the entryPath of the (visible) HList element nearest to that
842
y-coordinate.
843
</DL>
844
<DL>
845
<DT> <I>pathName <B>see <I>entryPath</I></B>
846
</I></B>
847
<DD> Adjust the view in the HList so that the entry given by <I>entryPath</I></B> is
848
visible. If the entry is already visible then the command has no
849
effect; if the entry is near one edge of the window then the HList
850
scrolls to bring the element into view at the edge; otherwise the
851
HList widget scrolls to center the entry.
852
</DL>
853
<DL>
854
<DT> <I>pathName <B>selection <I>option</I></B> <I>arg ...</I></B>
855
</I></B>
856
<DD> This command is used to adjust the selection within a HList widget. It
857
has several forms, depending on <I>option</I></B>:
858
</DL>
859
<UL>
860
<DL>
861
<DT> <I>pathName <B>selection clear </B></I>?<I>from</I></B>? ?<I>to</I></B>?
862
</I></B>
863
<DD> When no extra arguments are given, deselects all of the list entrie(s)
864
in this HList widget. When only <I>from</I></B> is given, only the list
865
entry identified by <I>from</I></B> is deselected. When both <I>from</I></B> and
866
<I>to</I></B> are given, deselects all of the list entrie(s) between
867
between <I>from</I></B> and <I>to</I></B>, inclusive, without affecting the
868
selection state of entries outside that range.
869
</DL>
870
<DL>
871
<DT> <I>pathName <B>selection get</B></I>
872
</I></B>
873
<DD> This is an alias for the <B>info selection</B></I> widget command.
874
,
875
</DL>
876
<DL>
877
<DT> <I>pathName <B>selection includes <I>entryPath</I></B>
878
</I></B>
879
<DD> Returns 1 if the list entry indicated by <I>entryPath</I></B> is currently
880
selected; returns 0 otherwise.
881
</DL>
882
<DL>
883
<DT> <I>pathName <B>selection set <I>from</I></B> ?<I>to</I></B>?
884
</I></B>
885
<DD> Selects all of the list entrie(s) between between <I>from</I></B> and
886
<I>to</I></B>, inclusive, without affecting the selection state of entries
887
outside that range. When only <I>from</I></B> is given, only the list entry
888
identified by <I>from</I></B> is selected.
889
</DL>
890
</UL>
891
<DL>
892
<DT> <I>pathName <B>show <I>option ?entryPath?</I></B>
893
</I></B>
894
<DD> Show the entries that are hidden by the <B>hide</B></I> command,
895
<I>option</I></B> can be one of the following:
896
</DL>
897
<UL>
898
<DL>
899
<DT> <B>entry</B></I>
900
</I></B>
901
<DD> Shows the list entry identified by <I>entryPath</I></B>.
902
</DL>
903
<P>
904
Currently only the <B>entry</B></I> option is supported. Other options will
905
be added in future releases.
906
</UL>
907
<DL>
908
<DT> <I>pathName <B>xview <I>args</I></B>
909
</I></B>
910
<DD> This command is used to query and change the horizontal position of the
911
forms:
912
</DL>
913
<UL>
914
<DL>
915
<DT> <I>pathName <B>xview</B></I>
916
</I></B>
917
<DD> Returns a list containing two elements.  Each element is a real
918
fraction between 0 and 1; together they describe the horizontal span
919
that is visible in the window.  For example, if the first element is
920
</DL>
921
 
922
off-screen to the left, the middle 40% is visible in the window, and
923
40% of the entry is off-screen to the right. These are the same values
924
passed to scrollbars via the <B>-xscrollcommand</B></I> option.
925
<DL>
926
<DT> <I>pathName <B>xview</B></I> <I>entryPath</I></B>
927
</I></B>
928
<DD> Adjusts the view in the window so that the list entry identified by
929
<I>entryPath</I></B> is aligned to the left edge of the window.
930
</DL>
931
<DL>
932
<DT> <I>pathName <B>xview moveto<I> fraction</I></B>
933
</I></B>
934
<DD> Adjusts the view in the window so that <I>fraction</I></B> of the total
935
width of the HList is off-screen to the left. <I>fraction</I></B> must be
936
a fraction between 0 and 1.
937
</DL>
938
<DL>
939
<DT> <I>pathName <B>xview scroll <I>number what</I></B>
940
</I></B>
941
<DD> This command shifts the view in the window left or right according to
942
<I>number</I></B> and <I>what</I></B>. <I>Number</I></B> must be an integer.
943
<I>What</I></B> must be either <B>units</B></I> or <B>pages</B></I> or an
944
abbreviation of one of these. If <I>what</I></B> is <B>units</B></I>, the view
945
adjusts left or right by <I>number</I></B> character units (the width of
946
the <B>0</B></I> character) on the display; if it is <B>pages</B></I> then the
947
view adjusts by <I>number</I></B> screenfuls. If <I>number</I></B> is negative
948
then characters farther to the left become visible; if it is positive
949
then characters farther to the right become visible.
950
</DL>
951
</UL>
952
<DL>
953
<DT> <I>pathName <B>yview <I>?args</I></B>?
954
</I></B>
955
<DD> This command is used to query and change the vertical position of the
956
</DL>
957
<UL>
958
<DL>
959
<DT> <I>pathName <B>yview</B></I>
960
</I></B>
961
<DD> Returns a list containing two elements, both of which are real
962
fractions between 0 and 1.  The first element gives the position of
963
the list element at the top of the window, relative to the HList as a
964
whole (0.5 means it is halfway through the HList, for example).  The
965
second element gives the position of the list entry just after the
966
last one in the window, relative to the HList as a whole.  These are
967
the same values passed to scrollbars via the <B>-yscrollcommand</B></I>
968
option.
969
</DL>
970
<DL>
971
<DT> <I>pathName <B>yview</B></I> <I>entryPath</I></B>
972
</I></B>
973
<DD> Adjusts the view in the window so that the list entry given by
974
<I>entryPath</I></B> is displayed at the top of the window.
975
</DL>
976
<DL>
977
<DT> <I>pathName <B>yview moveto<I> fraction</I></B>
978
</I></B>
979
<DD> Adjusts the view in the window so that the list entry given by
980
<I>fraction</I></B> appears at the top of the window. <I>Fraction</I></B> is a
981
fraction between 0 and 1; 0 indicates the first entry in the
982
HList, 0.33 indicates the entry one-third the way through the
983
HList, and so on.
984
</DL>
985
<DL>
986
<DT> <I>pathName <B>yview scroll <I>number what</I></B>
987
</I></B>
988
<DD> This command adjust the view in the window up or down according to
989
<I>number</I></B> and <I>what</I></B>.  <I>Number</I></B> must be an integer.
990
<I>What</I></B> must be either <B>units</B></I> or <B>pages</B></I>.  If <I>what</I></B>
991
is <B>units</B></I>, the view adjusts up or down by <I>number</I></B> lines; if
992
it is <B>pages</B></I> then the view adjusts by <I>number</I></B> screenfuls.
993
If <I>number</I></B> is negative then earlier entries become visible; if
994
it is positive then later entries become visible.
995
</DL>
996
</UL>
997
</pre><H3>BINDINGS</H3>
998
<P>
999
<UL>
1000
[1] <BR>
1001
If the <B>-selectmode</B></I> is "browse", when the user drags the mouse
1002
pointer over the list entries, the entry under the pointer will be
1003
highlighted and the <B>-browsecmd</B></I> procedure will be called with
1004
one parameter, the entryPath of the highlighted entry. Only one entry
1005
can be highlighted at a time. The <B>-command</B></I> procedure will be
1006
called when the user double-clicks on a list entry.
1007
</UL>
1008
<UL>
1009
[2] <BR>
1010
If the <B>-selectmode</B></I> is "single", the entries will only be
1011
highlighted by mouse &lt;ButtonRelease-1&gt; events. When a new list entry
1012
is highlighted, the <B>-browsecmd</B></I> procedure will be called with
1013
one parameter indicating the highlighted list entry. The
1014
<B>-command</B></I> procedure will be called when the user double-clicks
1015
on a list entry.
1016
</UL>
1017
<UL>
1018
[3] <BR>
1019
If the <B>-selectmode</B></I> is "multiple", when the user drags the mouse
1020
pointer over the list entries, all the entries under the pointer will
1021
be highlighted. However, only a contiguous region of list entries can
1022
be selected. When the highlighted area is changed, the
1023
<B>-browsecmd</B></I> procedure will be called with an undefined
1024
parameter. It is the responsibility of the <B>-browsecmd</B></I> procedure
1025
to find out the exact highlighted selection in the HList. The
1026
<B>-command</B></I> procedure will be called when the user double-clicks
1027
on a list entry.
1028
</UL>
1029
<UL>
1030
[4] <BR>
1031
If the <B>-selectmode</B></I> is "extended", when the user drags the mouse
1032
pointer over the list entries, all the entries under the pointer will
1033
be highlighted. The user can also make disjointed selections using
1034
&lt;Control-ButtonPress-1&gt;. When the highlighted area is changed, the
1035
<B>-browsecmd</B></I> procedure will be called with an undefined
1036
parameter. It is the responsibility of the <B>-browsecmd</B></I> procedure
1037
to find out the exact highlighted selection in the HList. The
1038
<B>-command</B></I> procedure will be called when the user double-clicks
1039
on a list entry.
1040
</UL>
1041
<UL>
1042
[5] <BR>
1043
<B>Arrow key bindings:</B></I> &lt;Up&gt; arrow key moves the anchor point to the
1044
item right on top of the current anchor item. &lt;Down&gt; arrow key moves
1045
the anchor point to the item right below the current anchor item.
1046
&lt;Left&gt; arrow key moves the anchor to the parent item of the current
1047
anchor item. &lt;Right&gt; moves the anchor to the first child of the
1048
current anchor item. If the current anchor item does not have any
1049
children, moves the anchor to the item right below the current anchor
1050
item.
1051
</UL>
1052
</pre><H3>EXAMPLE</H3>
1053
<P>
1054
This example demonstrates how to use an HList to store a file
1055
<P>
1056
\fC
1057
<pre><code><code><code>
1058
 tixHList .h -separator "/" -browsecmd browse -selectmode single \\
1059
    -itemtype text
1060
 .h add /         -text /
1061
 .h add /home     -text /home
1062
 .h add /home/ioi -text /home/ioi
1063
 .h add /home/foo -text /home/foo
1064
 .h add /usr      -text /usr
1065
 .h add /usr/lib  -text /usr/lib
1066
 pack .h
1067
 
1068
 proc browse {file} {
1069
     puts "$file browsed"
1070
 }
1071
</code></code></code></pre>
1072
</B></I>
1073
</pre><H3>BUGS</H3>
1074
The fact that the display item at column 0 is implicitly associated
1075
with the whole entry is probably a design bug. This was done for
1076
backward compatibility purposes. The result is that there is a large
1077
overlap between the <B>item</B></I> command and the <B>add</B></I>,
1078
<B>addchild</B></I>, <B>entrycget</B></I> and <B>entryconfigure</B></I>
1079
commands. Whenever multiple columns exist, the programmer should use
1080
ONLY the <B>item</B></I> command to create and configure the display items
1081
in each column; the <B>add</B></I>, <B>addchild</B></I>, <B>entrycget</B></I> and
1082
<B>entryconfigure</B></I> should be used ONLY to create and configure
1083
entries.
1084
</pre><H3>KEYWORDS</H3>
1085
Tix(n), Hierarchical Listbox
1086
<hr><i>Last modified Sun Jan 19 22:34:30 EST 1997 </i> ---
1087
<i>Serial 853731301</i>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.