| 1 | # NOTE: Derived from ../blib/lib/Tk/Scrollbar.pm. |
| 2 | # Changes made here will be lost when autosplit is run again. |
| 3 | # See AutoSplit.pm. |
| 4 | package Tk::Scrollbar; |
| 5 | |
| 6 | #line 390 "../blib/lib/Tk/Scrollbar.pm (autosplit into ../blib/lib/auto/Tk/Scrollbar/ScrlTopBottom.al)" |
| 7 | # tkScrlTopBottom |
| 8 | # Scroll to the top or bottom of the document, depending on the mouse |
| 9 | # position. |
| 10 | # |
| 11 | # Arguments: |
| 12 | # w - The scrollbar widget. |
| 13 | # x, y - Mouse coordinates within the widget. |
| 14 | |
| 15 | sub ScrlTopBottom |
| 16 | { |
| 17 | my $w = shift; |
| 18 | my $e = $w->XEvent; |
| 19 | my $element = $w->identify($e->x,$e->y); |
| 20 | return unless ($element); |
| 21 | if ($element =~ /1$/) |
| 22 | { |
| 23 | $w->ScrlToPos(0); |
| 24 | } |
| 25 | elsif ($element =~ /2$/) |
| 26 | { |
| 27 | $w->ScrlToPos(1); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | 1; |
| 32 | # end of Tk::Scrollbar::ScrlTopBottom |