Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 |
2 | .\" | |
3 | .\" Standard preamble: | |
4 | .\" ======================================================================== | |
5 | .de Sh \" Subsection heading | |
6 | .br | |
7 | .if t .Sp | |
8 | .ne 5 | |
9 | .PP | |
10 | \fB\\$1\fR | |
11 | .PP | |
12 | .. | |
13 | .de Sp \" Vertical space (when we can't use .PP) | |
14 | .if t .sp .5v | |
15 | .if n .sp | |
16 | .. | |
17 | .de Vb \" Begin verbatim text | |
18 | .ft CW | |
19 | .nf | |
20 | .ne \\$1 | |
21 | .. | |
22 | .de Ve \" End verbatim text | |
23 | .ft R | |
24 | .fi | |
25 | .. | |
26 | .\" Set up some character translations and predefined strings. \*(-- will | |
27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left | |
28 | .\" double quote, and \*(R" will give a right double quote. | will give a | |
29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to | |
30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' | |
31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. | |
32 | .tr \(*W-|\(bv\*(Tr | |
33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' | |
34 | .ie n \{\ | |
35 | . ds -- \(*W- | |
36 | . ds PI pi | |
37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch | |
38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch | |
39 | . ds L" "" | |
40 | . ds R" "" | |
41 | . ds C` "" | |
42 | . ds C' "" | |
43 | 'br\} | |
44 | .el\{\ | |
45 | . ds -- \|\(em\| | |
46 | . ds PI \(*p | |
47 | . ds L" `` | |
48 | . ds R" '' | |
49 | 'br\} | |
50 | .\" | |
51 | .\" If the F register is turned on, we'll generate index entries on stderr for | |
52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index | |
53 | .\" entries marked with X<> in POD. Of course, you'll have to process the | |
54 | .\" output yourself in some meaningful fashion. | |
55 | .if \nF \{\ | |
56 | . de IX | |
57 | . tm Index:\\$1\t\\n%\t"\\$2" | |
58 | .. | |
59 | . nr % 0 | |
60 | . rr F | |
61 | .\} | |
62 | .\" | |
63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes | |
64 | .\" way too many mistakes in technical documents. | |
65 | .hy 0 | |
66 | .if n .na | |
67 | .\" | |
68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). | |
69 | .\" Fear. Run. Save yourself. No user-serviceable parts. | |
70 | . \" fudge factors for nroff and troff | |
71 | .if n \{\ | |
72 | . ds #H 0 | |
73 | . ds #V .8m | |
74 | . ds #F .3m | |
75 | . ds #[ \f1 | |
76 | . ds #] \fP | |
77 | .\} | |
78 | .if t \{\ | |
79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) | |
80 | . ds #V .6m | |
81 | . ds #F 0 | |
82 | . ds #[ \& | |
83 | . ds #] \& | |
84 | .\} | |
85 | . \" simple accents for nroff and troff | |
86 | .if n \{\ | |
87 | . ds ' \& | |
88 | . ds ` \& | |
89 | . ds ^ \& | |
90 | . ds , \& | |
91 | . ds ~ ~ | |
92 | . ds / | |
93 | .\} | |
94 | .if t \{\ | |
95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" | |
96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' | |
97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' | |
98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' | |
99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' | |
100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' | |
101 | .\} | |
102 | . \" troff and (daisy-wheel) nroff accents | |
103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' | |
104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' | |
105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] | |
106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' | |
107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' | |
108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] | |
109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] | |
110 | .ds ae a\h'-(\w'a'u*4/10)'e | |
111 | .ds Ae A\h'-(\w'A'u*4/10)'E | |
112 | . \" corrections for vroff | |
113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' | |
114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' | |
115 | . \" for low resolution devices (crt and lpr) | |
116 | .if \n(.H>23 .if \n(.V>19 \ | |
117 | \{\ | |
118 | . ds : e | |
119 | . ds 8 ss | |
120 | . ds o a | |
121 | . ds d- d\h'-1'\(ga | |
122 | . ds D- D\h'-1'\(hy | |
123 | . ds th \o'bp' | |
124 | . ds Th \o'LP' | |
125 | . ds ae ae | |
126 | . ds Ae AE | |
127 | .\} | |
128 | .rm #[ #] #H #V #F C | |
129 | .\" ======================================================================== | |
130 | .\" | |
131 | .IX Title "TLIST 1" | |
132 | .TH TLIST 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation" | |
133 | .SH "NAME" | |
134 | Tk::TList \- Create and manipulate Tix Tabular List widgets | |
135 | .SH "SYNOPSIS" | |
136 | .IX Header "SYNOPSIS" | |
137 | \&\ \fI$tlist\fR = \fI$parent\fR\->\fBTList\fR(?\fIoptions\fR?); | |
138 | .SH "SUPER-CLASS" | |
139 | .IX Header "SUPER-CLASS" | |
140 | None. | |
141 | .SH "STANDARD OPTIONS" | |
142 | .IX Header "STANDARD OPTIONS" | |
143 | \&\fB\-background\fR \fB\-borderwidth\fR \fB\-class\fR \fB\-cursor\fR \fB\-foreground\fR | |
144 | \&\fB\-font\fR \fB\-height\fR \fB\-highlightcolor\fR \fB\-highlightthickness\fR | |
145 | \&\fB\-relief\fR \fB\-selectbackground\fR \fB\-selectforeground\fR | |
146 | \&\fB\-xscrollcommand\fR \fB\-yscrollcommand\fR \fB\-width\fR | |
147 | .PP | |
148 | See Tk::options for details of the standard options. | |
149 | .SH "WIDGET-SPECIFIC OPTIONS" | |
150 | .IX Header "WIDGET-SPECIFIC OPTIONS" | |
151 | .IP "Name: \fBbrowsecmd\fR" 4 | |
152 | .IX Item "Name: browsecmd" | |
153 | .PD 0 | |
154 | .IP "Class: \fBBrowseCmd\fR" 4 | |
155 | .IX Item "Class: BrowseCmd" | |
156 | .IP "Switch: \fB\-browsecmd\fR" 4 | |
157 | .IX Item "Switch: -browsecmd" | |
158 | .PD | |
159 | Specifies a perl/Tk \fBcallback\fR to be executed when the user browses through the | |
160 | entries in the TList widget. | |
161 | .IP "Name: \fBcommand\fR" 4 | |
162 | .IX Item "Name: command" | |
163 | .PD 0 | |
164 | .IP "Class: \fBCommand\fR" 4 | |
165 | .IX Item "Class: Command" | |
166 | .IP "Switch: \fB\-command\fR" 4 | |
167 | .IX Item "Switch: -command" | |
168 | .PD | |
169 | Specifies the perl/Tk \fBcallback\fR to be executed when the user invokes a list | |
170 | entry in the TList widget. Normally the user invokes a list | |
171 | entry by double-clicking it or pressing the Return key. | |
172 | .IP "Name: \fBforeground\fR" 4 | |
173 | .IX Item "Name: foreground" | |
174 | .PD 0 | |
175 | .IP "Class: \fBForeground\fR" 4 | |
176 | .IX Item "Class: Foreground" | |
177 | .IP "Switch: \fB\-foreground\fR" 4 | |
178 | .IX Item "Switch: -foreground" | |
179 | .IP "Alias: \fB\-fg\fR" 4 | |
180 | .IX Item "Alias: -fg" | |
181 | .PD | |
182 | Specifies the default foreground color for the list entries. | |
183 | .IP "Name: \fBheight\fR" 4 | |
184 | .IX Item "Name: height" | |
185 | .PD 0 | |
186 | .IP "Class: \fBHeight\fR" 4 | |
187 | .IX Item "Class: Height" | |
188 | .IP "Switch: \fB\-height\fR" 4 | |
189 | .IX Item "Switch: -height" | |
190 | .PD | |
191 | Specifies the desired height for the window in number of characters. | |
192 | .IP "Name: \fBitemType\fR" 4 | |
193 | .IX Item "Name: itemType" | |
194 | .PD 0 | |
195 | .IP "Class: \fBItemType\fR" 4 | |
196 | .IX Item "Class: ItemType" | |
197 | .IP "Switch: \fB\-itemtype\fR" 4 | |
198 | .IX Item "Switch: -itemtype" | |
199 | .PD | |
200 | Specifies the default type of display item for this TList widget. When | |
201 | you call the \fBinsert\fR methods, display items of this | |
202 | type will be created if the \fB\-itemtype\fR option is not specified. | |
203 | .IP "Name: \fBorient\fR" 4 | |
204 | .IX Item "Name: orient" | |
205 | .PD 0 | |
206 | .IP "Class: \fBOrient\fR" 4 | |
207 | .IX Item "Class: Orient" | |
208 | .IP "Switch: \fB\-orient\fR" 4 | |
209 | .IX Item "Switch: -orient" | |
210 | .PD | |
211 | Specifies the order of tabularizing the list entries. When set to | |
212 | "\fBvertical\fR\*(L", the entries are arranged in a column, from top to | |
213 | bottom. If the entries cannot be contained in one column, the | |
214 | remaining entries will go to the next column, and so on. When set to | |
215 | \&\*(R"\fBhorizontal\fR", the entries are arranged in a row, from left to | |
216 | right. If the entries cannot be contained in one row, the remaining | |
217 | entries will go to the next row, and so on. | |
218 | .IP "Name: \fBpadX\fR" 4 | |
219 | .IX Item "Name: padX" | |
220 | .PD 0 | |
221 | .IP "Class: \fBPad\fR" 4 | |
222 | .IX Item "Class: Pad" | |
223 | .IP "Switch: \fB\-padx\fR" 4 | |
224 | .IX Item "Switch: -padx" | |
225 | .PD | |
226 | The default horizontal padding for list entries. | |
227 | .IP "Name: \fBpadY\fR" 4 | |
228 | .IX Item "Name: padY" | |
229 | .PD 0 | |
230 | .IP "Class: \fBPad\fR" 4 | |
231 | .IX Item "Class: Pad" | |
232 | .IP "Switch: \fB\-padx\fR" 4 | |
233 | .IX Item "Switch: -padx" | |
234 | .PD | |
235 | The default vertical padding for list entries. | |
236 | .IP "Name: \fBselectBackground\fR" 4 | |
237 | .IX Item "Name: selectBackground" | |
238 | .PD 0 | |
239 | .IP "Class: \fBSelectBackground\fR" 4 | |
240 | .IX Item "Class: SelectBackground" | |
241 | .IP "Switch: \fB\-selectbackground\fR" 4 | |
242 | .IX Item "Switch: -selectbackground" | |
243 | .PD | |
244 | Specifies the background color for the selected list entries. | |
245 | .IP "Name: \fBselectBorderWidth\fR" 4 | |
246 | .IX Item "Name: selectBorderWidth" | |
247 | .PD 0 | |
248 | .IP "Class: \fBBorderWidth\fR" 4 | |
249 | .IX Item "Class: BorderWidth" | |
250 | .IP "Switch: \fB\-selectborderwidth\fR" 4 | |
251 | .IX Item "Switch: -selectborderwidth" | |
252 | .PD | |
253 | Specifies a non-negative value indicating the width of the 3\-D border | |
254 | to draw around selected items. The value may have any of the forms | |
255 | acceptable to \fBTk_GetPixels\fR. | |
256 | .IP "Name: \fBselectForeground\fR" 4 | |
257 | .IX Item "Name: selectForeground" | |
258 | .PD 0 | |
259 | .IP "Class: \fBSelectForeground\fR" 4 | |
260 | .IX Item "Class: SelectForeground" | |
261 | .IP "Switch: \fB\-selectforeground\fR" 4 | |
262 | .IX Item "Switch: -selectforeground" | |
263 | .PD | |
264 | Specifies the foreground color for the selected list entries. | |
265 | .IP "Name: \fBselectMode\fR" 4 | |
266 | .IX Item "Name: selectMode" | |
267 | .PD 0 | |
268 | .IP "Class: \fBSelectMode\fR" 4 | |
269 | .IX Item "Class: SelectMode" | |
270 | .IP "Switch: \fB\-selectmode\fR" 4 | |
271 | .IX Item "Switch: -selectmode" | |
272 | .PD | |
273 | Specifies one of several styles for manipulating the selection. The | |
274 | value of the option may be arbitrary, but the default bindings expect | |
275 | it to be either \fBsingle\fR, \fBbrowse\fR, \fBmultiple\fR, or | |
276 | \&\fBextended\fR; the default value is \fBsingle\fR. | |
277 | .IP "Name: \fBsizeCmd\fR" 4 | |
278 | .IX Item "Name: sizeCmd" | |
279 | .PD 0 | |
280 | .IP "Class: \fBSizeCmd\fR" 4 | |
281 | .IX Item "Class: SizeCmd" | |
282 | .IP "Switch: \fB\-sizecmd\fR" 4 | |
283 | .IX Item "Switch: -sizecmd" | |
284 | .PD | |
285 | Specifies a perl/Tk \fBcallback\fR to be called whenever the TList widget | |
286 | changes its size. This command can be useful to implement \*(L"user scroll | |
287 | bars when needed\*(R" features. | |
288 | .IP "Name: \fBstate\fR" 4 | |
289 | .IX Item "Name: state" | |
290 | .PD 0 | |
291 | .IP "Class: \fBState\fR" 4 | |
292 | .IX Item "Class: State" | |
293 | .IP "Switch: \fB\-state\fR" 4 | |
294 | .IX Item "Switch: -state" | |
295 | .PD | |
296 | Specifies whether the TList command should react to user actions. When | |
297 | set to "\fBnormal\fR\*(L", the TList reacts to user actions in the normal | |
298 | way. When set to \*(R"\fBdisabled\fR", the TList can only be scrolled, but | |
299 | its entries cannot be selected or activated. | |
300 | .IP "Name: \fBwidth\fR" 4 | |
301 | .IX Item "Name: width" | |
302 | .PD 0 | |
303 | .IP "Class: \fBWidth\fR" 4 | |
304 | .IX Item "Class: Width" | |
305 | .IP "Switch: \fB\-width\fR" 4 | |
306 | .IX Item "Switch: -width" | |
307 | .PD | |
308 | Specifies the desired width for the window in characters. | |
309 | .SH "DESCRIPTION" | |
310 | .IX Header "DESCRIPTION" | |
311 | The \fBTList\fR method creates a new window (given by the | |
312 | \&\f(CW$widget\fR argument) and makes it into a TList widget. | |
313 | Additional options, described above, may be specified on the command | |
314 | line or in the option database to configure aspects of the | |
315 | TList widget such as its cursor and relief. | |
316 | .PP | |
317 | The TList widget can be used to display data in a tabular format. The | |
318 | list entries of a TList widget are similar to the entries in the Tk | |
319 | listbox widget. The main differences are (1) the TList widget can | |
320 | display the list entries in a two dimensional format and (2) you can | |
321 | use graphical images as well as multiple colors and fonts for | |
322 | the list entries. | |
323 | .PP | |
324 | Each list entry is identified by an \fBindex\fR, which can be in the | |
325 | following forms: | |
326 | .IP "\fInumber\fR" 4 | |
327 | .IX Item "number" | |
328 | An integer that indicates the position of the entry in the list. 0 | |
329 | means the first position, 1 means the second position, and so on. | |
330 | .IP "\fBend\fR" 4 | |
331 | .IX Item "end" | |
332 | Indicates the end of the listbox. For some commands this means just | |
333 | after the last entry; for other commands it means the last entry. | |
334 | .IP "\fB@\fR\fIx\fR,\fIy\fR" 4 | |
335 | .IX Item "@x,y" | |
336 | Indicates the element that covers the point in the listbox window | |
337 | specified by x and y (in pixel coordinates). If no element covers that | |
338 | point, then the closest element to that point is used. | |
339 | .SH "DISPLAY ITEMS" | |
340 | .IX Header "DISPLAY ITEMS" | |
341 | Each list entry in an TList widget is associated with a \fBdisplay\fR | |
342 | item. The display item determines what visual information should | |
343 | be displayed for this list entry. Please see Tk::DItem | |
344 | for a list of all display items. | |
345 | .PP | |
346 | When a list entry is created by the \fBinsert\fR command, the type of | |
347 | its display item is determined by the \fB\-itemtype\fR option passed | |
348 | to these commands. If the \fB\-itemtype\fR is omitted, then by default | |
349 | the type specified by this TList widget's \fB\-itemtype\fR option is | |
350 | used. | |
351 | .SH "WIDGET METHODS" | |
352 | .IX Header "WIDGET METHODS" | |
353 | The \fBTList\fR method creates a widget object. | |
354 | .PP | |
355 | This object supports the \fBconfigure\fR and \fBcget\fR methods | |
356 | described in Tk::options which can be used to enquire and | |
357 | modify the options described above. | |
358 | The widget also inherits all the methods provided by the generic | |
359 | Tk::Widget class. | |
360 | .PP | |
361 | The following additional methods are available for TList widgets: | |
362 | .IP "\fI$tlist\fR\->\fBanchorSet\fR(\fIindex\fR)" 4 | |
363 | .IX Item "$tlist->anchorSet(index)" | |
364 | Sets the anchor to the list entry identified by \fIindex\fR. The | |
365 | anchor is the end of the selection that is fixed while dragging out a | |
366 | selection with the mouse. | |
367 | .IP "\fI$tlist\fR\->\fBanchorClear\fR" 4 | |
368 | .IX Item "$tlist->anchorClear" | |
369 | Removes the anchor, if any, from this TList widget. This only removes | |
370 | the surrounding highlights of the anchor entry and does not affect its | |
371 | selection status. | |
372 | .IP "\fI$tlist\fR\->\fBdelete\fR(\fIfrom, \fR?\fIto\fR?)" 4 | |
373 | .IX Item "$tlist->delete(from, ?to?)" | |
374 | Deletes one or more list entries between the two entries specified by | |
375 | the indices \fIfrom\fR and \fIto\fR. If \fIto\fR is not specified, deletes | |
376 | the single entry specified by \fIfrom\fR. | |
377 | .IP "\fI$tlist\fR\->\fBdragsiteSet\fR(\fIindex\fR)" 4 | |
378 | .IX Item "$tlist->dragsiteSet(index)" | |
379 | Sets the dragsite to the list entry identified by | |
380 | \&\fIindex\fR. The dragsite is used to indicate the source of a | |
381 | drag-and-drop action. Currently drag-and-drop functionality has not | |
382 | been implemented in Tix yet. | |
383 | .IP "\fI$tlist\fR\->\fBdragsiteClear\fR" 4 | |
384 | .IX Item "$tlist->dragsiteClear" | |
385 | Remove the dragsite, if any, from the this TList widget. This only | |
386 | removes the surrounding highlights of the dragsite entry and does not | |
387 | affect its selection status. | |
388 | .IP "\fI$tlist\fR\->\fBdropsiteSet\fR(\fIindex\fR)" 4 | |
389 | .IX Item "$tlist->dropsiteSet(index)" | |
390 | Sets the dropsite to the list entry identified by \fIindex\fR. The | |
391 | dropsite is used to indicate the target of a drag-and-drop | |
392 | action. Currently drag-and-drop functionality has not been implemented | |
393 | in Tix yet. | |
394 | .IP "\fI$tlist\fR\->\fBdropsiteClear\fR" 4 | |
395 | .IX Item "$tlist->dropsiteClear" | |
396 | Remove the dropsite, if any, from the this TList widget. This only | |
397 | removes the surrounding highlights of the dropsite entry and does not | |
398 | affect its selection status. | |
399 | .IP "\fI$tlist\fR\->\fBentrycget\fR(\fIindex, option\fR)" 4 | |
400 | .IX Item "$tlist->entrycget(index, option)" | |
401 | Returns the current value of the configuration option given by | |
402 | \&\fIoption\fR for the entry indentfied by \fIindex\fR. \fIOption\fR may | |
403 | have any of the values accepted by the \fBinsert\fR method. | |
404 | .IP "\fI$tlist\fR\->\fBentryconfigure\fR(\fIindex, \fR?\fIoption\fR?, \fI?value, option, value, ...\fR?)" 4 | |
405 | .IX Item "$tlist->entryconfigure(index, ?option?, ?value, option, value, ...?)" | |
406 | Query or modify the configuration options of the list entry identified | |
407 | by \fIindex\fR. If no \fIoption\fR is specified, returns a list | |
408 | describing all of the available options for \fIindex\fR (see | |
409 | \&\fBTk_ConfigureInfo\fR for information on the format of this list). If | |
410 | \&\fIoption\fR is specified with no \fIvalue\fR, then the method | |
411 | returns a list describing the one named option (this list will be | |
412 | identical to the corresponding sublist of the value returned if no | |
413 | \&\fIoption\fR is specified). If one or more \fIoption-value\fR pairs | |
414 | are specified, then the command modifies the given option(s) to have | |
415 | the given value(s); in this case the method returns an empty string. | |
416 | \&\fIOption\fR may have any of the values accepted by the \fBinsert\fR | |
417 | method. The exact set of options depends on the | |
418 | value of the \fB\-itemtype\fR option passed to the the \fBinsert\fR | |
419 | method when this list entry is created. | |
420 | .IP "\fI$tlist\fR\->\fBinsert\fR(\fIindex, \fR?\fIoption, value, ...\fR?)" 4 | |
421 | .IX Item "$tlist->insert(index, ?option, value, ...?)" | |
422 | Creates a new list entry at the position indicated by \fIindex\fR. The | |
423 | following configuration options can be given to configure the list | |
424 | entry: | |
425 | .RS 4 | |
426 | .IP "\fB\-itemtype\fR => \fItype\fR" 8 | |
427 | .IX Item "-itemtype => type" | |
428 | Specifies the type of display item to be display for the new list | |
429 | entry. \fItype\fR must be a valid display item type. Currently the | |
430 | available display item types are \fBimage\fR, \fBimagetext\fR, | |
431 | \&\fBtext\fR, and \fI$widget\fR. If this option is not specified, then by | |
432 | default the type specified by this TList widget's \fB\-itemtype\fR | |
433 | option is used. | |
434 | .IP "\fB\-state\fR => \fIstate\fR" 8 | |
435 | .IX Item "-state => state" | |
436 | Specifies whether this entry can be selected or invoked by the user. | |
437 | Must be either \fBnormal\fR or \fBdisabled\fR. | |
438 | .IP "\fB\-data\fR => \fIdata\fR" 8 | |
439 | .IX Item "-data => data" | |
440 | Arbitrary data to be associated with the entry (a perl scalar value). | |
441 | .RE | |
442 | .RS 4 | |
443 | .Sp | |
444 | The \fBinsert\fR method accepts additional configuration options | |
445 | to configure the display item associated with this list entry. The set | |
446 | of additional configuration options depends on the type of the display | |
447 | item given by the \fB\-itemtype\fR option. Please see | |
448 | Tk::DItem for a list of the configuration options for | |
449 | each of the display item types. | |
450 | .RE | |
451 | .IP "\fI$tlist\fR\->\fBinfo\fR(\fIoption, \fR\fIarg, ...\fR)" 4 | |
452 | .IX Item "$tlist->info(option, arg, ...)" | |
453 | Query information about the TList widget. \fIoption\fR can be one | |
454 | of the following: | |
455 | .RS 4 | |
456 | .IP "\fI$tlist\fR\->\fBinfo\fR(\fBanchor, \fR\fIindex\fR)" 8 | |
457 | .IX Item "$tlist->info(anchor, index)" | |
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 | .IP "\fI$tlist\fR\->\fBinfo\fR(\fBdragsite, \fR\fIindex\fR)" 8 | |
461 | .IX Item "$tlist->info(dragsite, index)" | |
462 | Returns the index of the current dragsite, if any, of the TList | |
463 | widget. If the dragsite is not set, returns the empty string. | |
464 | .IP "\fI$tlist\fR\->\fBinfo\fR(\fBdropsite, \fR\fIindex\fR)" 8 | |
465 | .IX Item "$tlist->info(dropsite, index)" | |
466 | Returns the index of the current dropsite, if any, of the TList | |
467 | widget. If the dropsite is not set, returns the empty string. | |
468 | .IP "\fI$tlist\fR\->\fBinfo\fR(\fBselection\fR)" 8 | |
469 | .IX Item "$tlist->info(selection)" | |
470 | Returns a list of selected elements in the TList widget. If no entries | |
471 | are selected, returns an empty string. | |
472 | .RE | |
473 | .RS 4 | |
474 | .RE | |
475 | .IP "\fI$tlist\fR\->\fBnearest\fR(\fIx, y\fR)" 4 | |
476 | .IX Item "$tlist->nearest(x, y)" | |
477 | Given an \fI(x,y)\fR coordinate within the TList window, this command | |
478 | returns the index of the TList element nearest to that coordinate. | |
479 | .IP "\fI$tlist\fR\->\fBsee\fR(\fIindex\fR)" 4 | |
480 | .IX Item "$tlist->see(index)" | |
481 | Adjust the view in the TList so that the entry given by \fIindex\fR is | |
482 | visible. If the entry is already visible then the command has no | |
483 | effect; otherwise TList scrolls to bring the element into view at the edge | |
484 | to which it is nearest. | |
485 | .IP "\fI$tlist\fR\->\fBselection\fR(\fIoption, \fR\fIarg, ...\fR)" 4 | |
486 | .IX Item "$tlist->selection(option, arg, ...)" | |
487 | This command is used to adjust the selection within a TList widget. It | |
488 | has several forms, depending on \fIoption\fR: | |
489 | .RS 4 | |
490 | .IP "\fI$tlist\fR\->\fBselectionClear\fR(?\fIfrom\fR?, ?\fIto\fR?)" 8 | |
491 | .IX Item "$tlist->selectionClear(?from?, ?to?)" | |
492 | When no extra arguments are given, deselects all of the list entrie(s) | |
493 | in this TList widget. When only \fIfrom\fR is given, only the list | |
494 | entry identified by \fIfrom\fR is deselected. When both \fIfrom\fR and | |
495 | \&\fIto\fR are given, deselects all of the list entrie(s) between | |
496 | between \fIfrom\fR and \fIto\fR, inclusive, without affecting the | |
497 | selection state of entries outside that range. | |
498 | .IP "\fI$tlist\fR\->\fBselectionIncludes\fR(\fIindex\fR)" 8 | |
499 | .IX Item "$tlist->selectionIncludes(index)" | |
500 | Returns 1 if the list entry indicated by \fIindex\fR is currently | |
501 | selected; returns 0 otherwise. | |
502 | .IP "\fI$tlist\fR\->\fBselectionSet\fR(\fIfrom, \fR?\fIto\fR?)" 8 | |
503 | .IX Item "$tlist->selectionSet(from, ?to?)" | |
504 | Selects all of the list entrie(s) between between \fIfrom\fR and | |
505 | \&\fIto\fR, inclusive, without affecting the selection state of entries | |
506 | outside that range. When only \fIfrom\fR is given, only the list entry | |
507 | identified by \fIfrom\fR is selected. | |
508 | .RE | |
509 | .RS 4 | |
510 | .RE | |
511 | .IP "\fI$tlist\fR\->\fBxview\fR(\fIargs\fR)" 4 | |
512 | .IX Item "$tlist->xview(args)" | |
513 | This command is used to query and change the horizontal position of the | |
514 | information in the widget's window. It can take any of the following | |
515 | forms: | |
516 | .RS 4 | |
517 | .IP "\fI$tlist\fR\->\fBxview\fR" 8 | |
518 | .IX Item "$tlist->xview" | |
519 | Returns a list containing two elements. Each element is a real | |
520 | fraction between 0 and 1; together they describe the horizontal span | |
521 | that is visible in the window. For example, if the first element is | |
522 | 0.2 and the second element is 0.6, 20% of the TList entry is | |
523 | off-screen to the left, the middle 40% is visible in the window, and | |
524 | 40% of the entry is off-screen to the right. These are the same values | |
525 | passed to scrollbars via the \fB\-xscrollcommand\fR option. | |
526 | .IP "\fI$tlist\fR\->\fBxview\fR(\fIindex\fR)" 8 | |
527 | .IX Item "$tlist->xview(index)" | |
528 | Adjusts the view in the window so that the list entry identified by | |
529 | \&\fIindex\fR is aligned to the left edge of the window. | |
530 | .IP "\fI$tlist\fR\->\fBxviewMoveto\fR(\fIfraction\fR)" 8 | |
531 | .IX Item "$tlist->xviewMoveto(fraction)" | |
532 | Adjusts the view in the window so that \fIfraction\fR of the total | |
533 | width of the TList is off-screen to the left. \fIfraction\fR must be | |
534 | a fraction between 0 and 1. | |
535 | .IP "\fI$tlist\fR\->\fBxviewScroll\fR(\fInumber, what\fR)" 8 | |
536 | .IX Item "$tlist->xviewScroll(number, what)" | |
537 | This command shifts the view in the window left or right according to | |
538 | \&\fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer. | |
539 | \&\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an | |
540 | abbreviation of one of these. If \fIwhat\fR is \fBunits\fR, the view | |
541 | adjusts left or right by \fInumber\fR character units (the width of | |
542 | the \fB0\fR character) on the display; if it is \fBpages\fR then the | |
543 | view adjusts by \fInumber\fR screenfuls. If \fInumber\fR is negative | |
544 | then characters farther to the left become visible; if it is positive | |
545 | then characters farther to the right become visible. | |
546 | .RE | |
547 | .RS 4 | |
548 | .RE | |
549 | .IP "\fI$tlist\fR\->\fByview\fR(\fI?args\fR?)" 4 | |
550 | .IX Item "$tlist->yview(?args?)" | |
551 | This command is used to query and change the vertical position of the | |
552 | entries in the widget's window. It can take any of the following forms: | |
553 | .RS 4 | |
554 | .IP "\fI$tlist\fR\->\fByview\fR" 8 | |
555 | .IX Item "$tlist->yview" | |
556 | Returns a list containing two elements, both of which are real | |
557 | fractions between 0 and 1. The first element gives the position of | |
558 | the list element at the top of the window, relative to the TList as a | |
559 | whole (0.5 means it is halfway through the TList, for example). The | |
560 | second element gives the position of the list entry just after the | |
561 | last one in the window, relative to the TList as a whole. These are | |
562 | the same values passed to scrollbars via the \fB\-yscrollcommand\fR | |
563 | option. | |
564 | .IP "\fI$tlist\fR\->\fByview\fR(\fIindex\fR)" 8 | |
565 | .IX Item "$tlist->yview(index)" | |
566 | Adjusts the view in the window so that the list entry given by | |
567 | \&\fIindex\fR is displayed at the top of the window. | |
568 | .IP "\fI$tlist\fR\->\fByviewMoveto\fR(\fIfraction\fR)" 8 | |
569 | .IX Item "$tlist->yviewMoveto(fraction)" | |
570 | Adjusts the view in the window so that the list entry given by | |
571 | \&\fIfraction\fR appears at the top of the window. \fIFraction\fR is a | |
572 | fraction between 0 and 1; 0 indicates the first entry in the TList, | |
573 | 0.33 indicates the entry one-third the way through the TList, and so | |
574 | on. | |
575 | .IP "\fI$tlist\fR\->\fByviewScroll\fR(\fInumber, what\fR)" 8 | |
576 | .IX Item "$tlist->yviewScroll(number, what)" | |
577 | This command adjust the view in the window up or down according to | |
578 | \&\fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer. | |
579 | \&\fIWhat\fR must be either \fBunits\fR or \fBpages\fR. If \fIwhat\fR | |
580 | is \fBunits\fR, the view adjusts up or down by \fInumber\fR lines; if | |
581 | it is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls. | |
582 | If \fInumber\fR is negative then earlier entries become visible; if | |
583 | it is positive then later entries become visible. | |
584 | .RE | |
585 | .RS 4 | |
586 | .RE | |
587 | .SH "BINDINGS" | |
588 | .IX Header "BINDINGS" | |
589 | .IP "[1]" 4 | |
590 | .IX Item "[1]" | |
591 | If the \fB\-selectmode\fR is \*(L"browse\*(R", when the user drags the mouse | |
592 | pointer over the list entries, the entry under the pointer will be | |
593 | highlighted and the \fB\-browsecmd\fR procedure will be called with | |
594 | one parameter, the index of the highlighted entry. Only one entry | |
595 | can be highlighted at a time. The \fB\-command\fR procedure will be | |
596 | called when the user double-clicks on a list entry. | |
597 | .IP "[2]" 4 | |
598 | .IX Item "[2]" | |
599 | If the \fB\-selectmode\fR is \*(L"single\*(R", the entries will only be | |
600 | highlighted by mouse <ButtonRelease\-1> events. When a new list entry | |
601 | is highlighted, the \fB\-browsecmd\fR procedure will be called with | |
602 | one parameter indicating the highlighted list entry. The | |
603 | \&\fB\-command\fR procedure will be called when the user double-clicks | |
604 | on a list entry. | |
605 | .IP "[3]" 4 | |
606 | .IX Item "[3]" | |
607 | If the \fB\-selectmode\fR is \*(L"multiple\*(R", when the user drags the mouse | |
608 | pointer over the list entries, all the entries under the pointer will | |
609 | be highlighted. However, only a contiguous region of list entries can | |
610 | be selected. When the highlighted area is changed, the | |
611 | \&\fB\-browsecmd\fR procedure will be called with an undefined | |
612 | parameter. It is the responsibility of the \fB\-browsecmd\fR procedure | |
613 | to find out the exact highlighted selection in the TList. The | |
614 | \&\fB\-command\fR procedure will be called when the user double-clicks | |
615 | on a list entry. | |
616 | .IP "[4]" 4 | |
617 | .IX Item "[4]" | |
618 | If the \fB\-selectmode\fR is \*(L"extended\*(R", when the user drags the mouse | |
619 | pointer over the list entries, all the entries under the pointer will | |
620 | be highlighted. The user can also make disjointed selections using | |
621 | <Control\-ButtonPress\-1>. When the highlighted area is changed, the | |
622 | \&\fB\-browsecmd\fR procedure will be called with an undefined | |
623 | parameter. It is the responsibility of the \fB\-browsecmd\fR procedure | |
624 | to find out the exact highlighted selection in the TList. The | |
625 | \&\fB\-command\fR procedure will be called when the user double-clicks | |
626 | on a list entry. | |
627 | .SH "EXAMPLE" | |
628 | .IX Header "EXAMPLE" | |
629 | This example demonstrates how to use an TList to store a list of | |
630 | numbers: | |
631 | .PP | |
632 | .Vb 3 | |
633 | \& use strict; | |
634 | \& use Tk (); | |
635 | \& use Tk::TList; | |
636 | .Ve | |
637 | .PP | |
638 | .Vb 7 | |
639 | \& my $mw = Tk::MainWindow->new(); | |
640 | \& my $image = $mw->Getimage('folder'); | |
641 | \& my $tlist = $mw->TList(-orient => 'vertical'); | |
642 | \& for my $text ( qw/one two three four five six seven eight nine/ ) { | |
643 | \& $tlist->insert('end', | |
644 | \& -itemtype=>'imagetext', -image=>$image, -text=>$text); | |
645 | \& } | |
646 | .Ve | |
647 | .PP | |
648 | .Vb 1 | |
649 | \& $tlist->pack(-expand=>'yes', -fill=>'both'); | |
650 | .Ve | |
651 | .PP | |
652 | .Vb 1 | |
653 | \& Tk::MainLoop; | |
654 | .Ve | |
655 | .SH "SEE ALSO" | |
656 | .IX Header "SEE ALSO" | |
657 | Tk::options | |
658 | Tk::Widget | |
659 | Tk::DItem | |
660 | Tk::HList | |
661 | Tk::TixGrid | |
662 | .SH "KEYWORDS" | |
663 | .IX Header "KEYWORDS" | |
664 | Tix(n), Tabular Listbox, Display Items |