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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [man/] [HList.n] - Blame information for rev 1774

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

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

powered by: WebSVN 2.1.0

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