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 317 "../blib/lib/Tk/Listbox.pm (autosplit into ../blib/lib/auto/Tk/Listbox/AutoScan.al)" | |
7 | # AutoScan -- | |
8 | # This procedure is invoked when the mouse leaves an entry window | |
9 | # with button 1 down. It scrolls the window up, down, left, or | |
10 | # right, depending on where the mouse left the window, and reschedules | |
11 | # itself as an "after" command so that the window continues to scroll until | |
12 | # the mouse moves back into the window or the mouse button is released. | |
13 | # | |
14 | # Arguments: | |
15 | # w - The entry window. | |
16 | # x - The x-coordinate of the mouse when it left the window. | |
17 | # y - The y-coordinate of the mouse when it left the window. | |
18 | sub AutoScan | |
19 | { | |
20 | my $w = shift; | |
21 | my $x = shift; | |
22 | my $y = shift; | |
23 | if ($y >= $w->height) | |
24 | { | |
25 | $w->yview('scroll',1,'units') | |
26 | } | |
27 | elsif ($y < 0) | |
28 | { | |
29 | $w->yview('scroll',-1,'units') | |
30 | } | |
31 | elsif ($x >= $w->width) | |
32 | { | |
33 | $w->xview('scroll',2,'units') | |
34 | } | |
35 | elsif ($x < 0) | |
36 | { | |
37 | $w->xview('scroll',-2,'units') | |
38 | } | |
39 | else | |
40 | { | |
41 | return; | |
42 | } | |
43 | $w->Motion($w->index("@" . $x . ',' . $y)); | |
44 | $w->RepeatId($w->after(50,'AutoScan',$w,$x,$y)); | |
45 | } | |
46 | ||
47 | # end of Tk::Listbox::AutoScan | |
48 | 1; |