Hello. I am trying to run a second script after I exit a menu created by Tk. The problem I am having is my code is stopping at MainLoop; and not running my last line of code. Is there a secret to this? Please see below:
use strict; use warnings; use Tk; my $mw = MainWindow->new; $mw->geometry("300x500"); $mw->title("Unforecasted Jobs"); my $check1 = 'NOT CHECKED'; my $check2 = 'NOT CHECKED'; my $check3 = 'NOT CHECKED'; my $check4 = 'NOT CHECKED'; my $check_frame = $mw->Frame()->pack(-side => "top"); $check_frame->Label(-text=>"Jobs That Do Not Forecast")->pack(-side => + "top")->pack(); my $job = "18L"; my $chk1 = $check_frame->Checkbutton(-text => '18-Letters', -variable => \$check1, -onvalue => 'ADDED', -offvalue => 'NOT CHECKED')->pack +(), -command => print OUTFILE "$job\n +"; my $job2 = "07O"; my $chk2 = $check_frame->Checkbutton(-text => '07-Orders', -variable => \$check2, -onvalue => 'ADDED', -offvalue => 'NOT CHECKED')->pack +(), -command => print OUTFILE "$job2\ +n"; my $job3 = "36L"; my $chk3 = $check_frame->Checkbutton(-text => '36-Letters', -variable => \$check3, -onvalue => 'ADDED', -offvalue => 'NOT CHECKED')->pack +(); -command => print OUTFILE "$job3\ +n"; my $job4 = "38L"; my $chk4 = $check_frame->Checkbutton(-text => '38-Letters', -variable => \$check4, -onvalue => 'ADDED', -offvalue => 'NOT CHECKED')->pack +(), -command => print OUTFILE "$job4\ +n"; my $button_frame = $mw->Frame()->pack(-side => "bottom"); my $ok_button = $button_frame->Button(-text => 'OK', -command => \&check_sub)->pack( +-side => "left"); my $exit_button = $button_frame->Button(-text => 'Exit', -command => sub{exit})->pack(- +side => "right"); sub check_sub { my $check_msg = "Check #1: $check1\nCheck #2: $check2\nCheck #3: $ch +eck3\nCheck #4: $check4\n; $mw->messageBox(-message => "Check Button Summary:\n$check_msg", -ty +pe => "ok"); } MainLoop; my $var =`crossref.pl`; #This is not executing.
In reply to Code after MainLoop; Tk by PerlCowboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |