#!/usr/bin/perl -w use strict; use Tk; my @scrollregion = (0,0,500,500); my $mw=tkinit; my $windowpane = $mw->Panedwindow( -orient => 'vertical' ) ->pack( -side => 'top' , -expand => 1, -fill => 'both' ); my $firstframe=$mw->Frame(); my $secondframe=$mw->Frame(); my $cf=$firstframe->Scrolled( 'Canvas', -bg=>'red', -scrollregion=>\@scrollregion, -confine=>1, -scrollbars=>'se') ->pack(-expand=>1, -fill=>'both', -anchor=>'nw'); $cf->create('rectangle',0,0,500,500); my $statusbar = $firstframe->Label( -text=>"This is a statusbar") ->pack(-fill=>'x', -expand=>0); my $tw = $secondframe->Scrolled( 'Text', -scrollbars=>'osoe') ->pack(-fill=>'both', -expand=>1, -anchor=>'nw'); $windowpane->add($firstframe, -sticky=>'nsew'); $windowpane->add($secondframe, -sticky=>'nsew'); $windowpane->bind( '' => \&OnResize ); $mw->bind( '' => \&OnResize ); MainLoop; sub OnResize{ my ($newx,$newy) = ($mw->width, $mw->height); $cf->configure( -scrollregion=>[0,0,$newx,$newy]); } #########################################################