#!/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('',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", -command => sub {&HelpTxt} )->pack (-side => 'left', -expand => 2); $HelpButton->bind('',\&HelpTxt); $mode_buttons->update; $mw->update; } $PartStep = $mw->Frame(-bg => "wheat1")->pack(-fill => 'both'); my $DrillButton = $PartStep->Button(-text => 'DRILL/ROUT', -command => 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; }