#!/usr/bin/perl -w
######################################################################
# canvas.pl
######################################################################
# Perl Power! - Michael Schilli 1998
######################################################################

use Tk;

my $top     = MainWindow->new();

my $canvas  = $top->Canvas();

$canvas->create('bitmap', 0, 0, -bitmap=>'@bitmap.xbm',
                                -anchor => 'nw',
                                -foreground => 'black',
                                -background => 'white');

my $yscrollbar = $top->Scrollbar(-command => ['yview', $canvas],
                                 -orient => 'vertical');
my $xscrollbar = $top->Scrollbar(-command => ['xview', $canvas], 
                                 -orient => 'horizontal');

$canvas->configure(-scrollregion => [0, 0, 330, 240]);

$canvas->configure(-xscrollcommand => ['set', $xscrollbar],
                   -yscrollcommand => ['set', $yscrollbar]);

$yscrollbar->pack(-side => 'right', -fill => 'y');
$xscrollbar->pack(-side => 'bottom', -fill => 'x');

$canvas->pack(-expand => 'yes', -fill => 'both');

MainLoop;

