Commit | Line | Data |
---|---|---|
86530b38 AT |
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 363 "../blib/lib/Tk/Scrollbar.pm (autosplit into ../blib/lib/auto/Tk/Scrollbar/ScrlToPos.al)" | |
7 | # tkScrlToPos -- | |
8 | # This procedure tells the scrollbar's associated widget to scroll to | |
9 | # a particular location, given by a fraction between 0 and 1. It notifies | |
10 | # the associated widget in different ways for old and new command syntaxes. | |
11 | # | |
12 | # Arguments: | |
13 | # w - The scrollbar widget. | |
14 | # pos - A fraction between 0 and 1 indicating a desired position | |
15 | # in the document. | |
16 | ||
17 | sub ScrlToPos | |
18 | { | |
19 | my $w = shift; | |
20 | my $pos = shift; | |
21 | my $cmd = $w->cget('-command'); | |
22 | return unless (defined $cmd); | |
23 | my @info = $w->get; | |
24 | if (@info == 2) | |
25 | { | |
26 | $cmd->Call('moveto',$pos); | |
27 | } | |
28 | else | |
29 | { | |
30 | $cmd->Call(int($info[0]*$pos)); | |
31 | } | |
32 | } | |
33 | ||
34 | # end of Tk::Scrollbar::ScrlToPos | |
35 | 1; |