Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | # NOTE: Derived from blib/lib/Tk/Frame.pm. |
2 | # Changes made here will be lost when autosplit is run again. | |
3 | # See AutoSplit.pm. | |
4 | package Tk::Frame; | |
5 | ||
6 | #line 221 "blib/lib/Tk/Frame.pm (autosplit into blib/lib/auto/Tk/Frame/AddScrollbars.al)" | |
7 | sub AddScrollbars | |
8 | { | |
9 | require Tk::Scrollbar; | |
10 | my ($cw,$w) = @_; | |
11 | my $def = ''; | |
12 | my ($x,$y) = ('',''); | |
13 | my $s = 0; | |
14 | my $c; | |
15 | $cw->freeze_on_map; | |
16 | foreach $c ($w->configure) | |
17 | { | |
18 | my $opt = $c->[0]; | |
19 | if ($opt eq '-yscrollcommand') | |
20 | { | |
21 | my $slice = Tk::Frame->new($cw,Name => 'ysbslice'); | |
22 | my $ysb = Tk::Scrollbar->new($slice,-orient => 'vertical', -command => [ 'yview', $w ]); | |
23 | my $size = $ysb->cget('-width'); | |
24 | my $corner = Tk::Frame->new($slice,Name=>'corner','-relief' => 'raised', | |
25 | '-width' => $size, '-height' => $size); | |
26 | $ysb->pack(-side => 'left', -fill => 'y'); | |
27 | $cw->Advertise('yscrollbar' => $ysb); | |
28 | $cw->Advertise('corner' => $corner); | |
29 | $cw->Advertise('ysbslice' => $slice); | |
30 | $corner->{'before'} = $ysb->PathName; | |
31 | $slice->{'before'} = $w->PathName; | |
32 | $y = 'w'; | |
33 | $s = 1; | |
34 | } | |
35 | elsif ($opt eq '-xscrollcommand') | |
36 | { | |
37 | my $xsb = Tk::Scrollbar->new($cw,-orient => 'horizontal', -command => [ 'xview', $w ]); | |
38 | $cw->Advertise('xscrollbar' => $xsb); | |
39 | $xsb->{'before'} = $w->PathName; | |
40 | $x = 's'; | |
41 | $s = 1; | |
42 | } | |
43 | } | |
44 | if ($s) | |
45 | { | |
46 | $cw->Advertise('scrolled' => $w); | |
47 | $cw->ConfigSpecs('-scrollbars' => ['METHOD','scrollbars','Scrollbars',$x.$y]); | |
48 | } | |
49 | } | |
50 | ||
51 | # end of Tk::Frame::AddScrollbars | |
52 | 1; |