monksp has asked for the wisdom of the Perl Monks concerning the following question:
Anyone have any idea why that code shouldn't resize the window?#!/usr/bin/perl -w use Tk; use Tk::Label; use Tk::Button; use Tk::Menubutton; use Tk::Menu; use Tk::LabEntry; use Tk::Dialog; use Tk::DialogBox; use Tk::Frame; $mw = MainWindow->new(); get_job(); $mw->update; MainLoop(); sub get_job { $wjLabEntry = $mw->Frame(-bg => "wheat1")->pack(); my $jobentry = $wjLabEntry->Entry(-width => 10)->pack(-side +=> 'left'); $mode_buttons = $mw->Frame(-bg => "wheat1")->pack(); my $DoButton = $mode_buttons->Button(-text => 'Continue', -command + => sub {&do_setup()} )->pack (-side => 'left', -expand => 1); my $QuitButton = $mode_buttons->Button(-text => 'Quit', -command = +> sub {Tk::exit} )->pack (-side => 'left', -expand => 1); my $HelpButton = $mode_buttons->Button(-text => "Help", -command = +> sub {&HelpTxt} )->pack (-side => 'left', -expand => 1); $jobentry->focus; $jobentry->bind('<Return>',sub {$DoButton->focus}); } sub do_setup { if (Exists $wjLabEntry) { $wjLabEntry->destroy; $mode_buttons->destroy; $wjLabEntry = $mw->Frame(-bg => "wheat1")->pack(); $mode_buttons = $mw->Frame(-bg => "wheat1")->pack(); my $QuitButton = $mode_buttons->Button(-text => "Terminate", - +command => sub {Tk::exit} )->pack (-side => 'left', -expand => 2); my $HelpButton = $mode_buttons->Button(-text => "Help", -comma +nd => sub {&HelpTxt} )->pack (-side => 'left', -expand => 2); $HelpButton->bind('<e>',\&HelpTxt); $mode_buttons->update; $mw->update; } $PartStep = $mw->Frame(-bg => "wheat1")->pack(-fill => 'both'); my $DrillButton = $PartStep->Button(-text => 'DRILL/ROUT', -comman +d => sub {&getDrill();&CleanUp();} )->pack(-side => 'left'); my $ToolButton = $PartStep->Button(-text => 'TOOLING', -command => + sub {&getTool();&CleanUp();} )->pack(-side => 'left'); my $AllButton = $PartStep->Button(-text => 'All', -command => sub +{&getTool();&CleanUp();} )->pack(-side => 'right', -fill => 'x', -expand = +> 1,); $mw->update; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problems after upgrading both Perl and Tk
by graff (Chancellor) on Jul 10, 2009 at 19:27 UTC | |
by monksp (Acolyte) on Jul 10, 2009 at 21:05 UTC | |
|
Re: Problems after upgrading both Perl and Tk
by graff (Chancellor) on Jul 10, 2009 at 18:33 UTC | |
|
Re: Problems after upgrading both Perl and Tk
by Anonymous Monk on Jul 10, 2009 at 17:13 UTC |