Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | # NOTE: Derived from ../blib/lib/Tk/Listbox.pm. |
2 | # Changes made here will be lost when autosplit is run again. | |
3 | # See AutoSplit.pm. | |
4 | package Tk::Listbox; | |
5 | ||
6 | #line 174 "../blib/lib/Tk/Listbox.pm (autosplit into ../blib/lib/auto/Tk/Listbox/BeginSelect.al)" | |
7 | # BeginSelect -- | |
8 | # | |
9 | # This procedure is typically invoked on button-1 presses. It begins | |
10 | # the process of making a selection in the listbox. Its exact behavior | |
11 | # depends on the selection mode currently in effect for the listbox; | |
12 | # see the Motif documentation for details. | |
13 | # | |
14 | # Arguments: | |
15 | # w - The listbox widget. | |
16 | # el - The element for the selection operation (typically the | |
17 | # one under the pointer). Must be in numerical form. | |
18 | sub BeginSelect | |
19 | { | |
20 | my $w = shift; | |
21 | my $el = shift; | |
22 | if ($w->cget('-selectmode') eq 'multiple') | |
23 | { | |
24 | if ($w->selectionIncludes($el)) | |
25 | { | |
26 | $w->selectionClear($el) | |
27 | } | |
28 | else | |
29 | { | |
30 | $w->selectionSet($el) | |
31 | } | |
32 | } | |
33 | else | |
34 | { | |
35 | $w->selectionClear(0,'end'); | |
36 | $w->selectionSet($el); | |
37 | $w->selectionAnchor($el); | |
38 | @Selection = (); | |
39 | $Prev = $el | |
40 | } | |
41 | $w->focus if ($w->cget('-takefocus')); | |
42 | } | |
43 | ||
44 | # end of Tk::Listbox::BeginSelect | |
45 | 1; |