in reply to Perl/Tk Scroll
You need to set the canvas' scrollregion to the size of the image (plus anything else on the canvas).
use strict; use Tk; my $mw = MainWindow->new; my $mycanvas = $mw->Scrolled( "Canvas", -width=>800, -height=>600, -scrollregion => [0,0,1019,1600], -scrollbars=>'se' )->pack(-expand => 1, -fill => 'both'); my $headerpicpath = '/some/path/image_1019_wide_1600_high.gif'; my $pic = $mw->Photo(-file=>$headerpicpath); $mycanvas->createImage(0,0,-image=>$pic,-anchor=>'nw'); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl/Tk Scroll
by mikasue (Friar) on Oct 31, 2011 at 02:40 UTC |