Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Tk::Listbox.3
CommitLineData
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 "LISTBOX 1"
132.TH LISTBOX 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134Tk::Listbox \- Create and manipulate Listbox widgets
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137\&\fI$listbox\fR = \fI$parent\fR\->\fBListbox\fR(?\fIoptions\fR?);
138.SH "STANDARD OPTIONS"
139.IX Header "STANDARD OPTIONS"
140\&\fB\-background\fR \fB\-foreground\fR \fB\-relief\fR \fB\-takefocus\fR
141\&\fB\-borderwidth\fR \fB\-height\fR \fB\-selectbackground\fR \fB\-width\fR
142\&\fB\-cursor\fR \fB\-highlightbackground\fR \fB\-selectborderwidth\fR \fB\-xscrollcommand\fR
143\&\fB\-exportselection\fR \fB\-highlightcolor\fR \fB\-selectforeground\fR \fB\-yscrollcommand\fR
144\&\fB\-font\fR \fB\-highlightthickness\fR \fB\-setgrid\fR
145.PP
146See Tk::options for details of the standard options.
147.SH "WIDGET-SPECIFIC OPTIONS"
148.IX Header "WIDGET-SPECIFIC OPTIONS"
149.IP "Name: \fBheight\fR" 4
150.IX Item "Name: height"
151.PD 0
152.IP "Class: \fBHeight\fR" 4
153.IX Item "Class: Height"
154.IP "Switch: \fB\-height\fR" 4
155.IX Item "Switch: -height"
156.PD
157Specifies the desired height for the window, in lines.
158If zero or less, then the desired height for the window is made just
159large enough to hold all the elements in the listbox.
160.IP "Name: \fBselectMode\fR" 4
161.IX Item "Name: selectMode"
162.PD 0
163.IP "Class: \fBSelectMode\fR" 4
164.IX Item "Class: SelectMode"
165.IP "Switch: \fB\-selectmode\fR" 4
166.IX Item "Switch: -selectmode"
167.PD
168Specifies one of several styles for manipulating the selection.
169The value of the option may be arbitrary, but the default bindings
170expect it to be either \fBsingle\fR, \fBbrowse\fR, \fBmultiple\fR,
171or \fBextended\fR; the default value is \fBbrowse\fR.
172.IP "Name: \fBwidth\fR" 4
173.IX Item "Name: width"
174.PD 0
175.IP "Class: \fBWidth\fR" 4
176.IX Item "Class: Width"
177.IP "Switch: \fB\-width\fR" 4
178.IX Item "Switch: -width"
179.PD
180Specifies the desired width for the window in characters.
181If the font doesn't have a uniform width then the width of the
182character ``0'' is used in translating from character units to
183screen units.
184If zero or less, then the desired width for the window is made just
185large enough to hold all the elements in the listbox.
186.SH "DESCRIPTION"
187.IX Header "DESCRIPTION"
188The \fBListbox\fR method creates a new window (given by the
189\&\f(CW$widget\fR argument) and makes it into a listbox widget.
190Additional
191options, described above, may be specified on the command line
192or in the option database
193to configure aspects of the listbox such as its colors, font,
194text, and relief. The \fBlistbox\fR command returns its
195\&\f(CW$widget\fR argument. At the time this command is invoked,
196there must not exist a window named \f(CW$widget\fR, but
197\&\f(CW$widget\fR's parent must exist.
198.PP
199A listbox is a widget that displays a list of strings, one per line.
200When first created, a new listbox has no elements.
201Elements may be added or deleted using methods described
202below. In addition, one or more elements may be selected as described
203below.
204If a listbox is exporting its selection (see \fBexportSelection\fR
205option), then it will observe the standard X11 protocols
206for handling the selection.
207Listbox selections are available as type \fB\s-1STRING\s0\fR;
208the value of the selection will be the text of the selected elements, with
209newlines separating the elements.
210.PP
211It is not necessary for all the elements to be
212displayed in the listbox window at once; commands described below
213may be used to change the view in the window. Listboxes allow
214scrolling in both directions using the standard \fBxScrollCommand\fR
215and \fByScrollCommand\fR options.
216They also support scanning, as described below.
217.SH "INDICES"
218.IX Header "INDICES"
219Many of the methods for listboxes take one or more indices
220as arguments.
221An index specifies a particular element of the listbox, in any of
222the following ways:
223.IP "\fInumber\fR" 4
224.IX Item "number"
225Specifies the element as a numerical index, where 0 corresponds
226to the first element in the listbox.
227.IP "\fBactive\fR" 4
228.IX Item "active"
229Indicates the element that has the location cursor. This element
230will be displayed with an underline when the listbox has the
231keyboard focus, and it is specified with the \fBactivate\fR
232method.
233.IP "\fBanchor\fR" 4
234.IX Item "anchor"
235Indicates the anchor point for the selection, which is set with the
236\&\fBselection anchor\fR method.
237.IP "\fBend\fR" 4
238.IX Item "end"
239Indicates the end of the listbox.
240For most commands this refers to the last element in the listbox,
241but for a few commands such as \fBindex\fR and \fBinsert\fR
242it refers to the element just after the last one.
243.IP "\fB@\fR\fIx\fR\fB,\fR\fIy\fR" 4
244.IX Item "@x,y"
245Indicates the element that covers the point in the listbox window
246specified by \fIx\fR and \fIy\fR (in pixel coordinates). If no
247element covers that point, then the closest element to that
248point is used.
249.PP
250In the method descriptions below, arguments named \fIindex\fR,
251\&\fIfirst\fR, and \fIlast\fR always contain text indices in one of
252the above forms.
253.SH "WIDGET METHODS"
254.IX Header "WIDGET METHODS"
255The \fBListbox\fR method creates a widget object.
256This object supports the \fBconfigure\fR and \fBcget\fR methods
257described in Tk::options which can be used to enquire and
258modify the options described above.
259The widget also inherits all the methods provided by the generic
260Tk::Widget class.
261.PP
262The following additional methods are available for listbox widgets:
263.IP "\fI$listbox\fR\->\fBactivate\fR(\fIindex\fR)" 4
264.IX Item "$listbox->activate(index)"
265Sets the active element to the one indicated by \fIindex\fR.
266If \fIindex\fR is outside the range of elements in the listbox
267then the closest element is activated.
268The active element is drawn with an underline when the widget
269has the input focus, and its index may be retrieved with the
270index \fBactive\fR.
271.IP "\fI$listbox\fR\->\fBbbox\fR(\fIindex\fR)" 4
272.IX Item "$listbox->bbox(index)"
273Returns a list of four numbers describing the bounding box of
274the text in the element given by \fIindex\fR.
275The first two elements of the list give the x and y coordinates
276of the upper-left corner of the screen area covered by the text
277(specified in pixels relative to the widget) and the last two
278elements give the width and height of the area, in pixels.
279If no part of the element given by \fIindex\fR is visible on the
280screen,
281or if \fIindex\fR refers to a non-existent element,
282then the result is an empty string; if the element is
283partially visible, the result gives the full area of the element,
284including any parts that are not visible.
285.IP "\fI$listbox\fR\->\fBcurselection\fR" 4
286.IX Item "$listbox->curselection"
287Returns a list containing the numerical indices of
288all of the elements in the listbox that are currently selected.
289If there are no elements selected in the listbox then an empty
290string is returned.
291.IP "\fI$listbox\fR\->\fBdelete\fR(\fIfirst, \fR?\fIlast\fR?)" 4
292.IX Item "$listbox->delete(first, ?last?)"
293Deletes one or more elements of the listbox. \fIFirst\fR and \fIlast\fR
294are indices specifying the first and last elements in the range
295to delete. If \fIlast\fR isn't specified it defaults to
296\&\fIfirst\fR, i.e. a single element is deleted.
297.IP "\fI$listbox\fR\->\fBget\fR(\fIfirst, \fR?\fIlast\fR?)" 4
298.IX Item "$listbox->get(first, ?last?)"
299If \fIlast\fR is omitted, returns the contents of the listbox
300element indicated by \fIfirst\fR,
301or an empty string if \fIfirst\fR refers to a non-existent element.
302If \fIlast\fR is specified, the command returns a list whose elements
303are all of the listbox elements between \fIfirst\fR and \fIlast\fR,
304inclusive.
305Both \fIfirst\fR and \fIlast\fR may have any of the standard
306forms for indices.
307.IP "\fI$listbox\fR\->\fBindex\fR(\fIindex\fR)" 4
308.IX Item "$listbox->index(index)"
309Returns the integer index value that corresponds to \fIindex\fR.
310If \fIindex\fR is \fBend\fR the return value is a count of the number
311of elements in the listbox (not the index of the last element).
312.IP "\fI$listbox\fR\->\fBinsert\fR(\fIindex, \fR?\fIelement, element, ...\fR?)" 4
313.IX Item "$listbox->insert(index, ?element, element, ...?)"
314Inserts zero or more new elements in the list just before the
315element given by \fIindex\fR. If \fIindex\fR is specified as
316\&\fBend\fR then the new elements are added to the end of the
317list. Returns an empty string.
318.IP "\fI$listbox\fR\->\fBnearest\fR(\fIy\fR)" 4
319.IX Item "$listbox->nearest(y)"
320Given a y\-coordinate within the listbox window, this command returns
321the index of the (visible) listbox element nearest to that y\-coordinate.
322.IP "\fI$listbox\fR\->\fBscan\fR(\fIoption, args\fR)" 4
323.IX Item "$listbox->scan(option, args)"
324This command is used to implement scanning on listboxes. It has
325two forms, depending on \fIoption\fR:
326.RS 4
327.IP "\fI$listbox\fR\->\fBscanMark\fR(\fIx, y\fR)" 8
328.IX Item "$listbox->scanMark(x, y)"
329Records \fIx\fR and \fIy\fR and the current view in the listbox
330window; used in conjunction with later \fBscan dragto\fR commands.
331Typically this command is associated with a mouse button press in
332the widget. It returns an empty string.
333.IP "\fI$listbox\fR\->\fBscanDragto\fR(\fIx, y\fR.)" 8
334.IX Item "$listbox->scanDragto(x, y.)"
335This command computes the difference between its \fIx\fR and \fIy\fR
336arguments and the \fIx\fR and \fIy\fR arguments to the last
337\&\fBscan mark\fR command for the widget.
338It then adjusts the view by 10 times the
339difference in coordinates. This command is typically associated
340with mouse motion events in the widget, to produce the effect of
341dragging the list at high speed through the window. The return
342value is an empty string.
343.RE
344.RS 4
345.RE
346.IP "\fI$listbox\fR\->\fBsee\fR(\fIindex\fR)" 4
347.IX Item "$listbox->see(index)"
348Adjust the view in the listbox so that the element given by \fIindex\fR
349is visible.
350If the element is already visible then the command has no effect;
351if the element is near one edge of the window then the listbox
352scrolls to bring the element into view at the edge; otherwise
353the listbox scrolls to center the element.
354.IP "\fI$listbox\fR\->\fBselection\fR(\fIoption, arg\fR)" 4
355.IX Item "$listbox->selection(option, arg)"
356This command is used to adjust the selection within a listbox. It
357has several forms, depending on \fIoption\fR:
358.RS 4
359.IP "\fI$listbox\fR\->\fBselectionAnchor\fR(\fIindex\fR)" 8
360.IX Item "$listbox->selectionAnchor(index)"
361Sets the selection anchor to the element given by \fIindex\fR.
362If \fIindex\fR refers to a non-existent element, then the closest
363element is used.
364The selection anchor is the end of the selection that is fixed
365while dragging out a selection with the mouse.
366The index \fBanchor\fR may be used to refer to the anchor
367element.
368.IP "\fI$listbox\fR\->\fBselectionClear\fR(\fIfirst, \fR?\fIlast\fR?)" 8
369.IX Item "$listbox->selectionClear(first, ?last?)"
370If any of the elements between \fIfirst\fR and \fIlast\fR
371(inclusive) are selected, they are deselected.
372The selection state is not changed for elements outside
373this range.
374.IP "\fI$listbox\fR\->\fBselectionIncludes\fR(\fIindex\fR)" 8
375.IX Item "$listbox->selectionIncludes(index)"
376Returns 1 if the element indicated by \fIindex\fR is currently
377selected, 0 if it isn't.
378.IP "\fI$listbox\fR\->\fBselectionSet\fR(\fIfirst, \fR?\fIlast\fR?)" 8
379.IX Item "$listbox->selectionSet(first, ?last?)"
380Selects all of the elements in the range between
381\&\fIfirst\fR and \fIlast\fR, inclusive, without affecting
382the selection state of elements outside that range.
383.RE
384.RS 4
385.RE
386.IP "\fI$listbox\fR\->\fBsize\fR" 4
387.IX Item "$listbox->size"
388Returns a decimal string indicating the total number of elements
389in the listbox.
390.IP "\fI$listbox\fR\->\fBxview\fR(\fIargs\fR)" 4
391.IX Item "$listbox->xview(args)"
392This command is used to query and change the horizontal position of the
393information in the widget's window. It can take any of the following
394forms:
395.RS 4
396.IP "\fI$listbox\fR\->\fBxview\fR" 8
397.IX Item "$listbox->xview"
398Returns a list containing two elements.
399Each element is a real fraction between 0 and 1; together they describe
400the horizontal span that is visible in the window.
401For example, if the first element is .2 and the second element is .6,
40220% of the listbox's text is off-screen to the left, the middle 40% is visible
403in the window, and 40% of the text is off-screen to the right.
404These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
405option.
406.IP "\fI$listbox\fR\->\fBxview\fR(\fIindex\fR)" 8
407.IX Item "$listbox->xview(index)"
408Adjusts the view in the window so that the character position given by
409\&\fIindex\fR is displayed at the left edge of the window.
410Character positions are defined by the width of the character \fB0\fR.
411.IP "\fI$listbox\fR\->\fBxview\fR(\fBmoveto\fR => \fIfraction\fR)" 8
412.IX Item "$listbox->xview(moveto => fraction)"
413Adjusts the view in the window so that \fIfraction\fR of the
414total width of the listbox text is off-screen to the left.
415\&\fIfraction\fR must be a fraction between 0 and 1.
416.IP "\fI$listbox\fR\->\fBxview\fR(\fBscroll\fR => \fInumber, what\fR)" 8
417.IX Item "$listbox->xview(scroll => number, what)"
418This command shifts the view in the window left or right according to
419\&\fInumber\fR and \fIwhat\fR.
420\&\fINumber\fR must be an integer.
421\&\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation
422of one of these.
423If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
424\&\fInumber\fR character units (the width of the \fB0\fR character)
425on the display; if it is \fBpages\fR then the view adjusts by
426\&\fInumber\fR screenfuls.
427If \fInumber\fR is negative then characters farther to the left
428become visible; if it is positive then characters farther to the right
429become visible.
430.RE
431.RS 4
432.RE
433.IP "\fI$listbox\fR\->\fByview\fR(\fI?args\fR?)" 4
434.IX Item "$listbox->yview(?args?)"
435This command is used to query and change the vertical position of the
436text in the widget's window.
437It can take any of the following forms:
438.RS 4
439.IP "\fI$listbox\fR\->\fByview\fR" 8
440.IX Item "$listbox->yview"
441Returns a list containing two elements, both of which are real fractions
442between 0 and 1.
443The first element gives the position of the listbox element at the
444top of the window, relative to the listbox as a whole (0.5 means
445it is halfway through the listbox, for example).
446The second element gives the position of the listbox element just after
447the last one in the window, relative to the listbox as a whole.
448These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR
449option.
450.IP "\fI$listbox\fR\->\fByview\fR(\fIindex\fR)" 8
451.IX Item "$listbox->yview(index)"
452Adjusts the view in the window so that the element given by
453\&\fIindex\fR is displayed at the top of the window.
454.IP "\fI$listbox\fR\->\fByview\fR(\fBmoveto\fR => \fIfraction\fR)" 8
455.IX Item "$listbox->yview(moveto => fraction)"
456Adjusts the view in the window so that the element given by \fIfraction\fR
457appears at the top of the window.
458\&\fIFraction\fR is a fraction between 0 and 1; 0 indicates the first
459element in the listbox, 0.33 indicates the element one-third the
460way through the listbox, and so on.
461.IP "\fI$listbox\fR\->\fByview\fR(\fBscroll\fR => \fInumber, what\fR)" 8
462.IX Item "$listbox->yview(scroll => number, what)"
463This command adjusts the view in the window up or down according to
464\&\fInumber\fR and \fIwhat\fR.
465\&\fINumber\fR must be an integer.
466\&\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.
467If \fIwhat\fR is \fBunits\fR, the view adjusts up or down by
468\&\fInumber\fR lines; if it is \fBpages\fR then
469the view adjusts by \fInumber\fR screenfuls.
470If \fInumber\fR is negative then earlier elements
471become visible; if it is positive then later elements
472become visible.
473.RE
474.RS 4
475.RE
476.SH "DEFAULT BINDINGS"
477.IX Header "DEFAULT BINDINGS"
478Tk automatically creates class bindings for listboxes that give them
479Motif-like behavior. Much of the behavior of a listbox is determined
480by its \fBselectMode\fR option, which selects one of four ways
481of dealing with the selection.
482.PP
483If the selection mode is \fBsingle\fR or \fBbrowse\fR, at most one
484element can be selected in the listbox at once.
485In both modes, clicking button 1 on an element selects
486it and deselects any other selected item.
487In \fBbrowse\fR mode it is also possible to drag the selection
488with button 1.
489.PP
490If the selection mode is \fBmultiple\fR or \fBextended\fR,
491any number of elements may be selected at once, including discontiguous
492ranges. In \fBmultiple\fR mode, clicking button 1 on an element
493toggles its selection state without affecting any other elements.
494In \fBextended\fR mode, pressing button 1 on an element selects
495it, deselects everything else, and sets the anchor to the element
496under the mouse; dragging the mouse with button 1
497down extends the selection to include all the elements between
498the anchor and the element under the mouse, inclusive.
499.PP
500Most people will probably want to use \fBbrowse\fR mode for
501single selections and \fBextended\fR mode for multiple selections;
502the other modes appear to be useful only in special situations.
503.PP
504In addition to the above behavior, the following additional behavior
505is defined by the default bindings:
506.IP "[1]" 4
507.IX Item "[1]"
508In \fBextended\fR mode, the selected range can be adjusted by pressing
509button 1 with the Shift key down: this modifies the selection to
510consist of the elements between the anchor and the element under
511the mouse, inclusive.
512The un-anchored end of this new selection can also be dragged with
513the button down.
514.IP "[2]" 4
515.IX Item "[2]"
516In \fBextended\fR mode, pressing button 1 with the Control key down
517starts a toggle operation: the anchor is set to the element under
518the mouse, and its selection state is reversed. The selection state
519of other elements isn't changed.
520If the mouse is dragged with button 1 down, then the selection state
521of all elements between the anchor and the element under the mouse
522is set to match that of the anchor element; the selection state of
523all other elements remains what it was before the toggle operation
524began.
525.IP "[3]" 4
526.IX Item "[3]"
527If the mouse leaves the listbox window with button 1 down, the window
528scrolls away from the mouse, making information visible that used
529to be off-screen on the side of the mouse.
530The scrolling continues until the mouse re-enters the window, the
531button is released, or the end of the listbox is reached.
532.IP "[4]" 4
533.IX Item "[4]"
534Mouse button 2 may be used for scanning.
535If it is pressed and dragged over the listbox, the contents of
536the listbox drag at high speed in the direction the mouse moves.
537.IP "[5]" 4
538.IX Item "[5]"
539If the Up or Down key is pressed, the location cursor (active
540element) moves up or down one element.
541If the selection mode is \fBbrowse\fR or \fBextended\fR then the
542new active element is also selected and all other elements are
543deselected.
544In \fBextended\fR mode the new active element becomes the
545selection anchor.
546.IP "[6]" 4
547.IX Item "[6]"
548In \fBextended\fR mode, Shift-Up and Shift-Down move the location
549cursor (active element) up or down one element and also extend
550the selection to that element in a fashion similar to dragging
551with mouse button 1.
552.IP "[7]" 4
553.IX Item "[7]"
554The Left and Right keys scroll the listbox view left and right
555by the width of the character \fB0\fR.
556Control-Left and Control-Right scroll the listbox view left and
557right by the width of the window.
558Control-Prior and Control-Next also scroll left and right by
559the width of the window.
560.IP "[8]" 4
561.IX Item "[8]"
562The Prior and Next keys scroll the listbox view up and down
563by one page (the height of the window).
564.IP "[9]" 4
565.IX Item "[9]"
566The Home and End keys scroll the listbox horizontally to
567the left and right edges, respectively.
568.IP "[10]" 4
569.IX Item "[10]"
570Control-Home sets the location cursor to the the first element in
571the listbox, selects that element, and deselects everything else
572in the listbox.
573.IP "[11]" 4
574.IX Item "[11]"
575Control-End sets the location cursor to the the last element in
576the listbox, selects that element, and deselects everything else
577in the listbox.
578.IP "[12]" 4
579.IX Item "[12]"
580In \fBextended\fR mode, Control-Shift-Home extends the selection
581to the first element in the listbox and Control-Shift-End extends
582the selection to the last element.
583.IP "[13]" 4
584.IX Item "[13]"
585In \fBmultiple\fR mode, Control-Shift-Home moves the location cursor
586to the first element in the listbox and Control-Shift-End moves
587the location cursor to the last element.
588.IP "[14]" 4
589.IX Item "[14]"
590The space and Select keys make a selection at the location cursor
591(active element) just as if mouse button 1 had been pressed over
592this element.
593.IP "[15]" 4
594.IX Item "[15]"
595In \fBextended\fR mode, Control-Shift-space and Shift-Select
596extend the selection to the active element just as if button 1
597had been pressed with the Shift key down.
598.IP "[16]" 4
599.IX Item "[16]"
600In \fBextended\fR mode, the Escape key cancels the most recent
601selection and restores all the elements in the selected range
602to their previous selection state.
603.IP "[17]" 4
604.IX Item "[17]"
605Control-slash selects everything in the widget, except in
606\&\fBsingle\fR and \fBbrowse\fR modes, in which case it selects
607the active element and deselects everything else.
608.IP "[18]" 4
609.IX Item "[18]"
610Control-backslash deselects everything in the widget, except in
611\&\fBbrowse\fR mode where it has no effect.
612.IP "[19]" 4
613.IX Item "[19]"
614The F16 key (labelled Copy on many Sun workstations) or Meta-w
615copies the selection in the widget to the clipboard, if there is
616a selection.
617.Sp
618The behavior of listboxes can be changed by defining new bindings for
619individual widgets or by redefining the class bindings.
620.SH "KEYWORDS"
621.IX Header "KEYWORDS"
622listbox, widget