#!/usr/bin/perl -w use Tk; use strict; my $mw = MainWindow->new; my $vh = $mw->vrootheight; my $vw = $mw->vrootwidth; # Note that the 'virtual window' height and width are $vh and $vw # respectively, so we use those dimensions for our Canvas height # and width, and let the Canvas expand and fill in both x and y # directions. # my $c = $mw->Canvas( -width => $vw, -height => $vh, -background =>'blue', -scrollregion =>[0, 0, 100, 100]); $c->pack(-expand => 1, -fill => 'both'); $c->createRectangle(100, 100, 150, 150, -fill => 'yellow'); MainLoop;