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 tixTList tix 4.0
|
15 |
|
|
.BS
|
16 |
|
|
'
|
17 |
|
|
'
|
18 |
|
|
'----------------------------------------------------------------------
|
19 |
|
|
.SH NAME
|
20 |
|
|
tixTList \- Create and manipulate Tix Tabular List widgets
|
21 |
|
|
'
|
22 |
|
|
'
|
23 |
|
|
'----------------------------------------------------------------------
|
24 |
|
|
.SH SYNOPSIS
|
25 |
|
|
\fBtixTList\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 TList widget.
|
62 |
|
|
'----------END
|
63 |
|
|
'
|
64 |
|
|
'----------BEGIN
|
65 |
|
|
.LP
|
66 |
|
|
.nf
|
67 |
|
|
Name: \fBcommand\fR
|
68 |
|
|
Class: \fBCommand\fR
|
69 |
|
|
Switch: \fB\-command\fR
|
70 |
|
|
.fi
|
71 |
|
|
.IP
|
72 |
|
|
Specifies the TCL command to be executed when the user invokes a list
|
73 |
|
|
entry in the TList widget. Normally the user invokes a list
|
74 |
|
|
entry by double-clicking it or pressing the Return key.
|
75 |
|
|
'----------END
|
76 |
|
|
'
|
77 |
|
|
'----------BEGIN
|
78 |
|
|
.LP
|
79 |
|
|
.nf
|
80 |
|
|
Name: \fBforeground\fR
|
81 |
|
|
Class: \fBForeground\fR
|
82 |
|
|
Switch: \fB\-foreground\fR
|
83 |
|
|
Alias: \fB\-fg\fR
|
84 |
|
|
.fi
|
85 |
|
|
.IP
|
86 |
|
|
Specifies the default foreground color for the list entries.
|
87 |
|
|
'----------END
|
88 |
|
|
'
|
89 |
|
|
'----------BEGIN
|
90 |
|
|
.LP
|
91 |
|
|
.nf
|
92 |
|
|
Name: \fBheight\fR
|
93 |
|
|
Class: \fBHeight\fR
|
94 |
|
|
Switch: \fB\-height\fR
|
95 |
|
|
.fi
|
96 |
|
|
.IP
|
97 |
|
|
Specifies the desired height for the window in number of characters.
|
98 |
|
|
'----------END
|
99 |
|
|
'
|
100 |
|
|
'----------BEGIN
|
101 |
|
|
.LP
|
102 |
|
|
.nf
|
103 |
|
|
Name: \fBitemType\fR
|
104 |
|
|
Class: \fBItemType\fR
|
105 |
|
|
Switch: \fB\-itemtype\fR
|
106 |
|
|
.fi
|
107 |
|
|
.IP
|
108 |
|
|
Specifies the default type of display item for this TList widget. When
|
109 |
|
|
you call the \fBinsert\fR widget commands, display items of this
|
110 |
|
|
type will be created if the \fB\-itemtype\fR option is not specified .
|
111 |
|
|
'----------END
|
112 |
|
|
'
|
113 |
|
|
'----------BEGIN
|
114 |
|
|
.LP
|
115 |
|
|
.nf
|
116 |
|
|
Name: \fBorient\fR
|
117 |
|
|
Class: \fBOrient\fR
|
118 |
|
|
Switch: \fB\-orient\fR
|
119 |
|
|
.fi
|
120 |
|
|
.IP
|
121 |
|
|
Specifies the order of tabularizing the list entries. When set to
|
122 |
|
|
"\fBvertical\fR", the entries are arranged in a column, from top to
|
123 |
|
|
bottom. If the entries cannot be contained in one column, the
|
124 |
|
|
remaining entries will go to the next column, and so on. When set to
|
125 |
|
|
"\fBhorizontal\fR", the entries are arranged in a row, from left to
|
126 |
|
|
right. If the entries cannot be contained in one row, the remaining
|
127 |
|
|
entries will go to the next row, and so on.
|
128 |
|
|
'----------END
|
129 |
|
|
'
|
130 |
|
|
'----------BEGIN
|
131 |
|
|
.LP
|
132 |
|
|
.nf
|
133 |
|
|
Name: \fBpadX\fR
|
134 |
|
|
Class: \fBPad\fR
|
135 |
|
|
Switch: \fB\-padx\fR
|
136 |
|
|
.fi
|
137 |
|
|
.IP
|
138 |
|
|
The default horizontal padding for list entries.
|
139 |
|
|
'----------END
|
140 |
|
|
'
|
141 |
|
|
'----------BEGIN
|
142 |
|
|
.LP
|
143 |
|
|
.nf
|
144 |
|
|
Name: \fBpadY\fR
|
145 |
|
|
Class: \fBPad\fR
|
146 |
|
|
Switch: \fB\-padx\fR
|
147 |
|
|
.fi
|
148 |
|
|
.IP
|
149 |
|
|
The default vertical padding for list entries.
|
150 |
|
|
'----------END
|
151 |
|
|
'----------BEGIN
|
152 |
|
|
.LP
|
153 |
|
|
.nf
|
154 |
|
|
Name: \fBselectBackground\fR
|
155 |
|
|
Class: \fBSelectBackground\fR
|
156 |
|
|
Switch: \fB\-selectbackground\fR
|
157 |
|
|
.fi
|
158 |
|
|
.IP
|
159 |
|
|
Specifies the background color for the selected list entries.
|
160 |
|
|
'----------END
|
161 |
|
|
'
|
162 |
|
|
'----------BEGIN
|
163 |
|
|
.LP
|
164 |
|
|
.nf
|
165 |
|
|
Name: \fBselectBorderWidth\fR
|
166 |
|
|
Class: \fBBorderWidth\fR
|
167 |
|
|
Switch: \fB\-selectborderwidth\fR
|
168 |
|
|
.fi
|
169 |
|
|
.IP
|
170 |
|
|
Specifies a non-negative value indicating the width of the 3-D border
|
171 |
|
|
to draw around selected items. The value may have any of the forms
|
172 |
|
|
acceptable to \fBTk_GetPixels\fR.
|
173 |
|
|
'----------END
|
174 |
|
|
'
|
175 |
|
|
'----------BEGIN
|
176 |
|
|
.LP
|
177 |
|
|
.nf
|
178 |
|
|
Name: \fBselectForeground\fR
|
179 |
|
|
Class: \fBSelectForeground\fR
|
180 |
|
|
Switch: \fB\-selectforeground\fR
|
181 |
|
|
.fi
|
182 |
|
|
.IP
|
183 |
|
|
Specifies the foreground color for the selected list entries.
|
184 |
|
|
'----------END
|
185 |
|
|
'
|
186 |
|
|
'----------BEGIN
|
187 |
|
|
.LP
|
188 |
|
|
.nf
|
189 |
|
|
Name: \fBselectMode\fR
|
190 |
|
|
Class: \fBSelectMode\fR
|
191 |
|
|
Switch: \fB\-selectmode\fR
|
192 |
|
|
.fi
|
193 |
|
|
.IP
|
194 |
|
|
Specifies one of several styles for manipulating the selection. The
|
195 |
|
|
value of the option may be arbitrary, but the default bindings expect
|
196 |
|
|
it to be either \fBsingle\fR, \fBbrowse\fR, \fBmultiple\fR, or
|
197 |
|
|
\fBextended\fR; the default value is \fBsingle\fR.
|
198 |
|
|
'----------END
|
199 |
|
|
'
|
200 |
|
|
'----------BEGIN
|
201 |
|
|
.LP
|
202 |
|
|
.nf
|
203 |
|
|
Name: \fBsizeCmd\fR
|
204 |
|
|
Class: \fBSizeCmd\fR
|
205 |
|
|
Switch: \fB\-sizecmd\fR
|
206 |
|
|
.fi
|
207 |
|
|
.IP
|
208 |
|
|
Specifies a TCL script to be called whenever the TList widget
|
209 |
|
|
changes its size. This command can be useful to implement "user scroll
|
210 |
|
|
bars when needed" features.
|
211 |
|
|
'----------END
|
212 |
|
|
'
|
213 |
|
|
'----------BEGIN
|
214 |
|
|
.LP
|
215 |
|
|
.nf
|
216 |
|
|
Name: \fBstate\fR
|
217 |
|
|
Class: \fBState\fR
|
218 |
|
|
Switch: \fB\-state\fR
|
219 |
|
|
.fi
|
220 |
|
|
.IP
|
221 |
|
|
Specifies whether the TList command should react to user actions. When
|
222 |
|
|
set to "\fBnormal\fR", the TList reacts to user actions in the normal
|
223 |
|
|
way. When set to "\fBdisabled\fR", the TList can only be scrolled, but
|
224 |
|
|
its entries cannot be selected or activated.
|
225 |
|
|
'----------END
|
226 |
|
|
'
|
227 |
|
|
'----------BEGIN
|
228 |
|
|
.LP
|
229 |
|
|
.nf
|
230 |
|
|
Name: \fBwidth\fR
|
231 |
|
|
Class: \fBWidth\fR
|
232 |
|
|
Switch: \fB\-width\fR
|
233 |
|
|
.fi
|
234 |
|
|
.IP
|
235 |
|
|
Specifies the desired width for the window in characters.
|
236 |
|
|
'----------END
|
237 |
|
|
.BE
|
238 |
|
|
'
|
239 |
|
|
'
|
240 |
|
|
'----------------------------------------------------------------------
|
241 |
|
|
.SH DESCRIPTION
|
242 |
|
|
'
|
243 |
|
|
.PP
|
244 |
|
|
'
|
245 |
|
|
The \fBtixTList\fR command creates a new window (given by the
|
246 |
|
|
\fIpathName\fR argument) and makes it into a TList widget.
|
247 |
|
|
Additional options, described above, may be specified on the command
|
248 |
|
|
line or in the option database to configure aspects of the
|
249 |
|
|
TList widget such as its cursor and relief.
|
250 |
|
|
'
|
251 |
|
|
.PP
|
252 |
|
|
The TList widget can be used to display data in a tabular format. The
|
253 |
|
|
list entries of a TList widget are similar to the entries in the Tk
|
254 |
|
|
listbox widget. The main differences are (1) the TList widget can
|
255 |
|
|
display the list entries in a two dimensional format and (2) you can
|
256 |
|
|
use graphical images as well as multiple colors and fonts for
|
257 |
|
|
the list entries.
|
258 |
|
|
'
|
259 |
|
|
.PP
|
260 |
|
|
Each list entry is identified by an \fBindex\fR, which can be in the
|
261 |
|
|
following forms:
|
262 |
|
|
.RS
|
263 |
|
|
.TP
|
264 |
|
|
\fInumber\fR
|
265 |
|
|
'
|
266 |
|
|
An integer that indicates the position of the entry in the list. 0
|
267 |
|
|
means the first position, 1 means the second position, and so on.
|
268 |
|
|
'
|
269 |
|
|
.TP
|
270 |
|
|
\fBend\fR
|
271 |
|
|
'
|
272 |
|
|
Indicates the end of the listbox. For some commands this means just
|
273 |
|
|
after the last entry; for other commands it means the last entry.
|
274 |
|
|
'
|
275 |
|
|
.TP
|
276 |
|
|
\fB@\fR\fIx\fR,\fIy\fR
|
277 |
|
|
'
|
278 |
|
|
Indicates the element that covers the point in the listbox window
|
279 |
|
|
specified by x and y (in pixel coordinates). If no element covers that
|
280 |
|
|
point, then the closest element to that point is used.
|
281 |
|
|
'
|
282 |
|
|
.RE
|
283 |
|
|
'
|
284 |
|
|
.SH "DISPLAY ITEMS"
|
285 |
|
|
.PP
|
286 |
|
|
Each list entry in an TList widget is associated with a \fBdisplay
|
287 |
|
|
item\fR. The display item determines what visual information should
|
288 |
|
|
be displayed for this list entry. Please see the \fBDItem(n)\fR manual
|
289 |
|
|
page for a list of all display items.
|
290 |
|
|
'
|
291 |
|
|
.PP
|
292 |
|
|
When a list entry is created by the \fBinsert\fR command, the type of
|
293 |
|
|
its display item is determined by the \fB\-itemtype\fR option passed
|
294 |
|
|
to these commands. If the \fB\-itemtype\fR is omitted, then by default
|
295 |
|
|
the type specified by this TList widget's \fB\-itemtype\fR option is
|
296 |
|
|
used.
|
297 |
|
|
'----------------------------------------------------------------------
|
298 |
|
|
.SH "WIDGET COMMAND"
|
299 |
|
|
.PP
|
300 |
|
|
'
|
301 |
|
|
The \fBtixTList\fR command creates a new Tcl command whose name is the
|
302 |
|
|
same as the path name of the TList widget's window. This command
|
303 |
|
|
may be used to invoke various operations on the widget. It has the
|
304 |
|
|
following general form:
|
305 |
|
|
'
|
306 |
|
|
.DS C
|
307 |
|
|
'
|
308 |
|
|
\fIpathName option \fR?\fIarg arg ...\fR?
|
309 |
|
|
.PP
|
310 |
|
|
.DE
|
311 |
|
|
'
|
312 |
|
|
\fIPathName\fR is the name of the command, which is the same as
|
313 |
|
|
the TList widget's path name. \fIOption\fR and the \fIarg\fRs
|
314 |
|
|
determine the exact behavior of the command. The following
|
315 |
|
|
commands are possible for TList widgets:
|
316 |
|
|
'
|
317 |
|
|
.TP
|
318 |
|
|
\fIpathName \fBanchor set \fIindex\fR
|
319 |
|
|
'
|
320 |
|
|
Sets the anchor to the list entry identified by \fIindex\fR. The
|
321 |
|
|
anchor is the end of the selection that is fixed while dragging out a
|
322 |
|
|
selection with the mouse.
|
323 |
|
|
'
|
324 |
|
|
.TP
|
325 |
|
|
\fIpathName \fBanchor clear\fR
|
326 |
|
|
'
|
327 |
|
|
Removes the anchor, if any, from this TList widget. This only removes
|
328 |
|
|
the surrounding highlights of the anchor entry and does not affect its
|
329 |
|
|
selection status.
|
330 |
|
|
'
|
331 |
|
|
.TP
|
332 |
|
|
\fIpathName \fBcget\fR \fIoption\fR
|
333 |
|
|
'
|
334 |
|
|
Returns the current value of the configuration option given by
|
335 |
|
|
\fIoption\fR. \fIOption\fR may have any of the values accepted by the
|
336 |
|
|
\fBtixTList\fR command.
|
337 |
|
|
'
|
338 |
|
|
.TP
|
339 |
|
|
'
|
340 |
|
|
\fIpathName \fBconfigure\fR ?\fIoption\fR? \fI?value option value ...\fR?
|
341 |
|
|
'
|
342 |
|
|
Query or modify the configuration options of the widget. If no
|
343 |
|
|
\fIoption\fR is specified, returns a list describing all of the
|
344 |
|
|
available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
|
345 |
|
|
information on the format of this list). If \fIoption\fR is specified
|
346 |
|
|
with no \fIvalue\fR, then the command returns a list describing the
|
347 |
|
|
one named option (this list will be identical to the corresponding
|
348 |
|
|
sublist of the value returned if no \fIoption\fR is specified). If
|
349 |
|
|
one or more \fIoption\-value\fR pairs are specified, then the command
|
350 |
|
|
modifies the given widget option(s) to have the given value(s); in
|
351 |
|
|
this case the command returns an empty string. \fIOption\fR may have
|
352 |
|
|
any of the values accepted by the \fBtixTList\fR command.
|
353 |
|
|
'
|
354 |
|
|
.TP
|
355 |
|
|
\fIpathName \fBdelete\fR \fIfrom\fR ?\fIto\fR?
|
356 |
|
|
Deletes one or more list entries between the two entries specified by
|
357 |
|
|
the indices \fIfrom\fR and \fIto\fR. If \fIto\fR is not specified, deletes
|
358 |
|
|
the single entry specified by \fIfrom\fR.
|
359 |
|
|
'
|
360 |
|
|
.TP
|
361 |
|
|
\fIpathName \fBdragsite set \fIindex\fR
|
362 |
|
|
'
|
363 |
|
|
Sets the dragsite to the list entry identified by
|
364 |
|
|
\fIindex\fR. The dragsite is used to indicate the source of a
|
365 |
|
|
drag-and-drop action. Currently drag-and-drop functionality has not
|
366 |
|
|
been implemented in Tix yet.
|
367 |
|
|
'
|
368 |
|
|
.TP
|
369 |
|
|
\fIpathName \fBdragsite clear\fR
|
370 |
|
|
Remove the dragsite, if any, from the this TList widget. This only
|
371 |
|
|
removes the surrounding highlights of the dragsite entry and does not
|
372 |
|
|
affect its selection status.
|
373 |
|
|
'
|
374 |
|
|
'
|
375 |
|
|
.TP
|
376 |
|
|
\fIpathName \fBdropsite set \fIindex\fR
|
377 |
|
|
'
|
378 |
|
|
Sets the dropsite to the list entry identified by \fIindex\fR. The
|
379 |
|
|
dropsite is used to indicate the target of a grag-and-drop
|
380 |
|
|
action. Currently drag-and-drop functionality has not been implemented
|
381 |
|
|
in Tix yet.
|
382 |
|
|
'
|
383 |
|
|
.TP
|
384 |
|
|
\fIpathName \fBdropsite clear\fR
|
385 |
|
|
'
|
386 |
|
|
Remove the dropsite, if any, from the this TList widget. This only
|
387 |
|
|
removes the surrounding highlights of the dropsite entry and does not
|
388 |
|
|
affect its selection status.
|
389 |
|
|
'
|
390 |
|
|
.TP
|
391 |
|
|
\fIpathName \fBentrycget\fR \fIindex option\fR
|
392 |
|
|
'
|
393 |
|
|
Returns the current value of the configuration option given by
|
394 |
|
|
\fIoption\fR for the entry indentfied by \fIindex\fR. \fIOption\fR may
|
395 |
|
|
have any of the values accepted by the \fBinsert\fR widget command.
|
396 |
|
|
'
|
397 |
|
|
.TP
|
398 |
|
|
\fIpathName \fBentryconfigure\fI index \fR?\fIoption\fR? \fI?value option value ...\fR?
|
399 |
|
|
'
|
400 |
|
|
Query or modify the configuration options of the list entry indentfied
|
401 |
|
|
by \fIindex\fR. If no \fIoption\fR is specified, returns a list
|
402 |
|
|
describing all of the available options for \fIindex\fR (see
|
403 |
|
|
\fBTk_ConfigureInfo\fR for information on the format of this list). If
|
404 |
|
|
\fIoption\fR is specified with no \fIvalue\fR, then the command
|
405 |
|
|
returns a list describing the one named option (this list will be
|
406 |
|
|
identical to the corresponding sublist of the value returned if no
|
407 |
|
|
\fIoption\fR is specified). If one or more \fIoption\-value\fR pairs
|
408 |
|
|
are specified, then the command modifies the given option(s) to have
|
409 |
|
|
the given value(s); in this case the command returns an empty string.
|
410 |
|
|
\fIOption\fR may have any of the values accepted by the \fBinsert\fR
|
411 |
|
|
widget command. The exact set of options depends on the
|
412 |
|
|
value of the \fB\-itemtype\fR option passed to the the \fBinsert\fR
|
413 |
|
|
widget command when this list entry is created.
|
414 |
|
|
'
|
415 |
|
|
.TP
|
416 |
|
|
\fIpathName \fBinsert\fI index \fR?\fIoption value ...\fR?
|
417 |
|
|
'
|
418 |
|
|
Creates a new list entry at the position indicated by \fIindex\fR. The
|
419 |
|
|
following configuration options can be given to configure the list
|
420 |
|
|
entry:
|
421 |
|
|
'
|
422 |
|
|
.RS
|
423 |
|
|
'
|
424 |
|
|
.TP
|
425 |
|
|
\fB\-itemtype\fI type\fR
|
426 |
|
|
'
|
427 |
|
|
Specifies the type of display item to be display for the new list
|
428 |
|
|
entry. \fItype\fR must be a valid display item type. Currently the
|
429 |
|
|
available display item types are \fBimage\fR, \fBimagetext\fR,
|
430 |
|
|
\fBtext\fR, and \fBwindow\fR. If this option is not specified, then by
|
431 |
|
|
default the type specified by this TList widget's \fB\-itemtype\fR
|
432 |
|
|
option is used.
|
433 |
|
|
'
|
434 |
|
|
.TP
|
435 |
|
|
\fB\-state\fR
|
436 |
|
|
'
|
437 |
|
|
Specifies whether this entry can be selected or invoked by the user.
|
438 |
|
|
Must be either \fBnormal\fR or \fBdisabled\fR.
|
439 |
|
|
'
|
440 |
|
|
.RE
|
441 |
|
|
'
|
442 |
|
|
The \fBinsert\fR widget command accepts additional configuration options
|
443 |
|
|
to configure the display item associated with this list entry. The set
|
444 |
|
|
of additional configuration options depends on the type of the display
|
445 |
|
|
item given by the \fB\-itemtype\fR option. Please see the
|
446 |
|
|
\fBDItem(n)\fR manual page for a list of the configuration options for
|
447 |
|
|
each of the display item types.
|
448 |
|
|
'
|
449 |
|
|
.TP
|
450 |
|
|
\fIpathName \fBinfo \fIoption\fR \fIarg ...\fR
|
451 |
|
|
'
|
452 |
|
|
Query information about the TList widget. \fIoption\fR can be one
|
453 |
|
|
of the following:
|
454 |
|
|
.RS
|
455 |
|
|
.TP
|
456 |
|
|
\fIpathName \fBinfo \fBanchor\fR \fIindex\fR
|
457 |
|
|
;
|
458 |
|
|
Returns the index of the current anchor, if any, of the TList
|
459 |
|
|
widget. If the anchor is not set, returns the empty string.
|
460 |
|
|
'
|
461 |
|
|
.TP
|
462 |
|
|
\fIpathName \fBinfo \fBdragsite\fR \fIindex\fR
|
463 |
|
|
Returns the index of the current dragsite, if any, of the TList
|
464 |
|
|
widget. If the dragsite is not set, returns the empty string.
|
465 |
|
|
'
|
466 |
|
|
.TP
|
467 |
|
|
\fIpathName \fBinfo \fBdropsite\fR \fIindex\fR
|
468 |
|
|
Returns the index of the current dropsite, if any, of the TList
|
469 |
|
|
widget. If the dropsite is not set, returns the empty string.
|
470 |
|
|
'
|
471 |
|
|
.TP
|
472 |
|
|
\fIpathName \fBinfo \fBselection\fR
|
473 |
|
|
'
|
474 |
|
|
Returns a list of selected elements in the TList widget. If no entries
|
475 |
|
|
are selectd, returns an empty string.
|
476 |
|
|
.RE
|
477 |
|
|
'
|
478 |
|
|
.TP
|
479 |
|
|
\fIpathName \fBnearest \fIx y\fR
|
480 |
|
|
'
|
481 |
|
|
Given an (x,y) coordinate within the TList window, this command
|
482 |
|
|
returns the index of the TList element nearest to that coordinate.
|
483 |
|
|
'
|
484 |
|
|
'
|
485 |
|
|
.TP
|
486 |
|
|
\fIpathName \fBsee \fIindex\fR
|
487 |
|
|
'
|
488 |
|
|
Adjust the view in the TList so that the entry given by \fIindex\fR is
|
489 |
|
|
visible. If the entry is already visible then the command has no
|
490 |
|
|
effect; if the entry is near one edge of the window then the TList
|
491 |
|
|
scrolls to bring the element into view at the edge; otherwise the
|
492 |
|
|
TList widget scrolls to center the entry.
|
493 |
|
|
'
|
494 |
|
|
.TP
|
495 |
|
|
\fIpathName \fBselection \fIoption\fR \fIarg ...\fR
|
496 |
|
|
'
|
497 |
|
|
This command is used to adjust the selection within a TList widget. It
|
498 |
|
|
has several forms, depending on \fIoption\fR:
|
499 |
|
|
.RS
|
500 |
|
|
'
|
501 |
|
|
.TP
|
502 |
|
|
\fIpathName \fBselection clear \fR?\fIfrom\fR? ?\fIto\fR?
|
503 |
|
|
'
|
504 |
|
|
When no extra arguments are given, deselects all of the list entrie(s)
|
505 |
|
|
in this TList widget. When only \fIfrom\fR is given, only the list
|
506 |
|
|
entry identified by \fIfrom\fR is deselected. When both \fIfrom\fR and
|
507 |
|
|
\fIto\fR are given, deselects all of the list entrie(s) between
|
508 |
|
|
between \fIfrom\fR and \fIto\fR, inclusive, without affecting the
|
509 |
|
|
selection state of entries outside that range.
|
510 |
|
|
'
|
511 |
|
|
.TP
|
512 |
|
|
\fIpathName \fBselection includes \fIindex\fR
|
513 |
|
|
'
|
514 |
|
|
Returns 1 if the list entry indicated by \fIindex\fR is currently
|
515 |
|
|
selected; returns 0 otherwise.
|
516 |
|
|
'
|
517 |
|
|
.TP
|
518 |
|
|
\fIpathName \fBselection set \fIfrom\fR ?\fIto\fR?
|
519 |
|
|
'
|
520 |
|
|
Selects all of the list entrie(s) between between \fIfrom\fR and
|
521 |
|
|
\fIto\fR, inclusive, without affecting the selection state of entries
|
522 |
|
|
outside that range. When only \fIfrom\fR is given, only the list entry
|
523 |
|
|
identified by \fIfrom\fR is selected.
|
524 |
|
|
.RE
|
525 |
|
|
'
|
526 |
|
|
.TP
|
527 |
|
|
\fIpathName \fBxview \fIargs\fR
|
528 |
|
|
This command is used to query and change the horizontal position of the
|
529 |
|
|
information in the widget's window. It can take any of the following
|
530 |
|
|
forms:
|
531 |
|
|
.RS
|
532 |
|
|
.TP
|
533 |
|
|
\fIpathName \fBxview\fR
|
534 |
|
|
'
|
535 |
|
|
Returns a list containing two elements. Each element is a real
|
536 |
|
|
fraction between 0 and 1; together they describe the horizontal span
|
537 |
|
|
that is visible in the window. For example, if the first element is
|
538 |
|
|
.2 and the second element is .6, 20% of the TList entry is
|
539 |
|
|
off-screen to the left, the middle 40% is visible in the window, and
|
540 |
|
|
40% of the entry is off-screen to the right. These are the same values
|
541 |
|
|
passed to scrollbars via the \fB\-xscrollcommand\fR option.
|
542 |
|
|
.TP
|
543 |
|
|
\fIpathName \fBxview\fR \fIindex\fR
|
544 |
|
|
'
|
545 |
|
|
Adjusts the view in the window so that the list entry identified by
|
546 |
|
|
\fIindex\fR is aligned to the left edge of the window.
|
547 |
|
|
.TP
|
548 |
|
|
\fIpathName \fBxview moveto\fI fraction\fR
|
549 |
|
|
'
|
550 |
|
|
Adjusts the view in the window so that \fIfraction\fR of the total
|
551 |
|
|
width of the TList is off-screen to the left. \fIfraction\fR must be
|
552 |
|
|
a fraction between 0 and 1.
|
553 |
|
|
'
|
554 |
|
|
.TP
|
555 |
|
|
\fIpathName \fBxview scroll \fInumber what\fR
|
556 |
|
|
'
|
557 |
|
|
This command shifts the view in the window left or right according to
|
558 |
|
|
\fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer.
|
559 |
|
|
\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an
|
560 |
|
|
abbreviation of one of these. If \fIwhat\fR is \fBunits\fR, the view
|
561 |
|
|
adjusts left or right by \fInumber\fR character units (the width of
|
562 |
|
|
the \fB0\fR character) on the display; if it is \fBpages\fR then the
|
563 |
|
|
view adjusts by \fInumber\fR screenfuls. If \fInumber\fR is negative
|
564 |
|
|
then characters farther to the left become visible; if it is positive
|
565 |
|
|
then characters farther to the right become visible.
|
566 |
|
|
'
|
567 |
|
|
.RE
|
568 |
|
|
'
|
569 |
|
|
.TP
|
570 |
|
|
\fIpathName \fByview \fI?args\fR?
|
571 |
|
|
'
|
572 |
|
|
This command is used to query and change the vertical position of the
|
573 |
|
|
entries in the widget's window. It can take any of the following forms:
|
574 |
|
|
'
|
575 |
|
|
.RS
|
576 |
|
|
.TP
|
577 |
|
|
\fIpathName \fByview\fR
|
578 |
|
|
'
|
579 |
|
|
Returns a list containing two elements, both of which are real
|
580 |
|
|
fractions between 0 and 1. The first element gives the position of
|
581 |
|
|
the list element at the top of the window, relative to the TList as a
|
582 |
|
|
whole (0.5 means it is halfway through the TList, for example). The
|
583 |
|
|
second element gives the position of the list entry just after the
|
584 |
|
|
last one in the window, relative to the TList as a whole. These are
|
585 |
|
|
the same values passed to scrollbars via the \fB\-yscrollcommand\fR
|
586 |
|
|
option.
|
587 |
|
|
'
|
588 |
|
|
.TP
|
589 |
|
|
\fIpathName \fByview\fR \fIindex\fR
|
590 |
|
|
'
|
591 |
|
|
Adjusts the view in the window so that the list entry given by
|
592 |
|
|
\fIindex\fR is displayed at the top of the window.
|
593 |
|
|
'
|
594 |
|
|
.TP
|
595 |
|
|
\fIpathName \fByview moveto\fI fraction\fR
|
596 |
|
|
'
|
597 |
|
|
Adjusts the view in the window so that the list entry given by
|
598 |
|
|
\fIfraction\fR appears at the top of the window. \fIFraction\fR is a
|
599 |
|
|
fraction between 0 and 1; 0 indicates the first entry in the TList,
|
600 |
|
|
0.33 indicates the entry one-third the way through the TList, and so
|
601 |
|
|
on.
|
602 |
|
|
.TP
|
603 |
|
|
\fIpathName \fByview scroll \fInumber what\fR
|
604 |
|
|
'
|
605 |
|
|
This command adjust the view in the window up or down according to
|
606 |
|
|
\fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer.
|
607 |
|
|
\fIWhat\fR must be either \fBunits\fR or \fBpages\fR. If \fIwhat\fR
|
608 |
|
|
is \fBunits\fR, the view adjusts up or down by \fInumber\fR lines; if
|
609 |
|
|
it is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls.
|
610 |
|
|
If \fInumber\fR is negative then earlier entries become visible; if
|
611 |
|
|
it is positive then later entries become visible.
|
612 |
|
|
.RE
|
613 |
|
|
'
|
614 |
|
|
'----------------------------------------------------------------------
|
615 |
|
|
.SH BINDINGS
|
616 |
|
|
.PP
|
617 |
|
|
.IP [1]
|
618 |
|
|
If the \fB\-selectmode\fR is "browse", when the user drags the mouse
|
619 |
|
|
pointer over the list entries, the entry under the pointer will be
|
620 |
|
|
highlighted and the \fB\-browsecmd\fR procedure will be called with
|
621 |
|
|
one parameter, the index of the highlighted entry. Only one entry
|
622 |
|
|
can be highlighted at a time. The \fB\-command\fR procedure will be
|
623 |
|
|
called when the user double-clicks on a list entry.
|
624 |
|
|
'
|
625 |
|
|
.IP [2]
|
626 |
|
|
If the \fB\-selectmode\fR is "single", the entries will only be
|
627 |
|
|
highlighted by mouse events. When a new list entry
|
628 |
|
|
is highlighted, the \fB\-browsecmd\fR procedure will be called with
|
629 |
|
|
one parameter indicating the highlighted list entry. The
|
630 |
|
|
\fB\-command\fR procedure will be called when the user double-clicks
|
631 |
|
|
on a list entry.
|
632 |
|
|
'
|
633 |
|
|
'
|
634 |
|
|
.IP [3]
|
635 |
|
|
If the \fB\-selectmode\fR is "multiple", when the user drags the mouse
|
636 |
|
|
pointer over the list entries, all the entries under the pointer will
|
637 |
|
|
be highlighted. However, only a contiguous region of list entries can
|
638 |
|
|
be selected. When the highlighted area is changed, the
|
639 |
|
|
\fB\-browsecmd\fR procedure will be called with an undefined
|
640 |
|
|
parameter. It is the responsibility of the \fB\-browsecmd\fR procedure
|
641 |
|
|
to find out the exact highlighted selection in the TList. The
|
642 |
|
|
\fB\-command\fR procedure will be called when the user double-clicks
|
643 |
|
|
on a list entry.
|
644 |
|
|
'
|
645 |
|
|
.IP [4]
|
646 |
|
|
'
|
647 |
|
|
If the \fB\-selectmode\fR is "extended", when the user drags the mouse
|
648 |
|
|
pointer over the list entries, all the entries under the pointer will
|
649 |
|
|
be highlighted. The user can also make disjointed selections using
|
650 |
|
|
. When the highlighted area is changed, the
|
651 |
|
|
\fB\-browsecmd\fR procedure will be called with an undefined
|
652 |
|
|
parameter. It is the responsibility of the \fB\-browsecmd\fR procedure
|
653 |
|
|
to find out the exact highlighted selection in the TList. The
|
654 |
|
|
\fB\-command\fR procedure will be called when the user double-clicks
|
655 |
|
|
on a list entry.
|
656 |
|
|
'
|
657 |
|
|
'----------------------------------------------------------------------
|
658 |
|
|
.SH EXAMPLE
|
659 |
|
|
.PP
|
660 |
|
|
This example demonstrates how to use an TList to store a list of
|
661 |
|
|
numbers:
|
662 |
|
|
.PP
|
663 |
|
|
\fC
|
664 |
|
|
.nf
|
665 |
|
|
set image [tix getimage folder]
|
666 |
|
|
tixTList .t -orient vertical
|
667 |
|
|
.t insert end -itemtype imagetext -image $image -text one
|
668 |
|
|
.t insert end -itemtype imagetext -image $image -text two
|
669 |
|
|
.t insert end -itemtype imagetext -image $image -text three
|
670 |
|
|
.t insert end -itemtype imagetext -image $image -text four
|
671 |
|
|
.t insert end -itemtype imagetext -image $image -text five
|
672 |
|
|
.t insert end -itemtype imagetext -image $image -text six
|
673 |
|
|
pack .t -expand yes -fill both
|
674 |
|
|
.fi
|
675 |
|
|
\fR
|
676 |
|
|
'
|
677 |
|
|
'
|
678 |
|
|
'----------------------------------------------------------------------
|
679 |
|
|
.SH KEYWORDS
|
680 |
|
|
Tix(n), Tabular Listbox, Display Items
|