#! /usr/bin/perl -w use strict; use Tk; my $mw = MainWindow->new(-title => "Try to put a line over an image" ); $mw -> Photo ('imggif', -file => 'C:/foo.gif'); my $cf = $mw->Frame; $cf->pack( -side => 'left', -fill => 'y', -expand => 1); my $label = $cf->Label( -image => 'imggif'); # $label->pack( -side => 'left', -fill => 'both', -expand => 1); $label->place( -anchor => 'nw', -relheight => 1, -relwidth => 1, -x => 0, -y => 0); my $c = $cf->Scrolled("Canvas", -cursor => 'crosshair', # was $mw-> -scrollbars => 'se') ->pack( -side => 'left', -fill => 'both', -expand => 1); my $line = $c->createLine(0,0,100,100, -width => 2, -fill => "red"); MainLoop;