Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use Tk; my $mw = MainWindow->new; my $c = $mw->Scrolled('Canvas')->pack(); my $canvas = $c->Subwidget('canvas'); $canvas->CanvasBind("<Button-1>", [ \&print_xy, Ev('x'), Ev('y') ]); sub print_xy { my ($canv, $x, $y) = @_; print "(x,y) = ",$canv->canvasx($x),", ",$canv->canvasy($y),"\n"; }
The code, as is, won't show any window. Why not? I even tried making a $mw label and packing it, but still nothing. What's up?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk Woes
by RMGir (Prior) on Jul 06, 2002 at 01:25 UTC |