Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a short Perl/Tk script that uses Frame widget. It runs fine on the ActivePerl port on Win2000, but blows up on Unix, which is SunOS 5.6 with Perl/Tk version b7. It complains at the line where I pack the widget into the Frame, saying it needs a package or object reference. Is it because Tk b7 doesn't support Frame or something ? Please provide any insight.Thanks very much.....
$fr4 = $mw->Frame()->pack(-side => 'bottom'); $fr4->Button( -text => 'Start Converter', -command => \&setModel )->pack(-side => 'left');

Replies are listed 'Best First'.
Re: Perl/Tk b7 and Frame
by rbc (Curate) on May 20, 2002 at 20:00 UTC
    I have a script I run on the cygwin port of perl
    This is perl, v5.6.1 built for cygwin-multi
    
    Here are the pertinent snippets from it ...
    ... my $top = MainWindow->new(); my $frame = $top->Frame(); my $can = $top->Canvas( -width => $width, -height=> $height, -background=>$background ); ... $can->packAdjust( -side => 'left', -fill => 'both', -delay => 1 ); $frame->pack( -side => 'left', -fill => 'y', -expand => 'y', -anchor => 'w' ); my $mbutton = $frame->Button( -relief => "groove", -text => "m = ", -command => \&incM )->pack( anchor => 'w' ); my $mentry = $frame->Entry( -width => 10, -textvariable => \$M)->form( -left => [$mbutton,0] ); ...
    Do you need to call $widget->packAdjust?