in reply to Re^2: Tk: Scaling canvas objects
in thread Tk: Scaling canvas objects
When you print out @_, you getsub paint_Info{ #this shows the problem my ($MW, $CW, $zoom) = @_; print "\n\n@_\n\n"; $CW->createOval( 30, 30, 15, 15, -outline => 'red', -width => 2, -tags => ['INFO']); my $zfactor = ($zoom > 0) ? $zoom : -1 / $zoom; $CW->scale('all', 0, 0, $zfactor, $zfactor); }
It just dawned on me! Your Frame is the Scrolled Frame the Canvas is in. Try getting the real canvas in your module. This fixes it! :-)
sub paint_Info # ($MW, $Config) { my ($MW, $CW, $zoom) = @_; print "\n\n@_\n\n"; my $canvas = $CW->Subwidget('canvas'); $canvas->createOval( 30, 30, 15, 15, -outline => 'red', -width => 2, -tags => ['INFO']); my $zfactor = ($zoom > 0) ? $zoom : -1 / $zoom; $canvas->scale('all', 0, 0, $zfactor, $zfactor); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Tk: Scaling canvas objects
by perldough (Sexton) on Jul 24, 2012 at 19:23 UTC | |
by zentara (Cardinal) on Jul 24, 2012 at 21:17 UTC |