When I run your review2.pm, I get your error. But I added a line which shows the problem. I can't figure out why it allowed you to create an Oval to begin with.?
sub 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);
}
When you print out @_, you get
MainWindow=HASH(0x7b8078) Tk::Frame=HASH(0xe2bfb0) 1
You then take $_
1 and try to run Canvas methods on it. Scale will not run on a Frame, that is a Canvas method.
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);
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.