use Tk; my $mw = MainWindow->new; my $c = $mw->Scrolled('Canvas')->pack(); my $canvas = $c->Subwidget('canvas'); $canvas->CanvasBind("", [ \&print_xy, Ev('x'), Ev('y') ]); sub print_xy { my ($canv, $x, $y) = @_; print "(x,y) = ",$canv->canvasx($x),", ",$canv->canvasy($y),"\n"; }