flnMichael
Programmer
HI all,
I have a little issue with my exit button randomly executing after I execute something on my menubar. So, for example, I go to "open file", select the file, click ok and then the exit function executes. Am I missing something in my creation of the buttons? Any help would be appreciated. Here is the code:
I have a little issue with my exit button randomly executing after I execute something on my menubar. So, for example, I go to "open file", select the file, click ok and then the exit function executes. Am I missing something in my creation of the buttons? Any help would be appreciated. Here is the code:
Code:
my $main = MainWindow->new();
$main->minsize(qw(250 150));
$main->resizable(0,0);
$main->configure(-background=>'grey');
$main->geometry("+100+100");
$main->focus;
my $mb = $main->Menu(-menuitems=>&menubar_menuitems() );
$main->configure(-menu=>$mb);
my $body = $main->Frame(-background=>'grey',-relief=>'groove')->pack(-side=>'top',-fill=>'x');
$statFrm = $body->Frame(-background=>'grey',)->pack(-side=>'top',-fill=>'x');
$btnFrm = $body->Frame(-background=>'grey',)->pack(-side=>'top');
$main->Button(-text=>'View Log',-state=>'disabled')->pack(-side=>'left',-anchor=>'sw');
$main->Button(-text=>'Exit',-command=>sub { print LOGFILE "This is exiting\n"; exit;},)->pack(-side=>'right',-anchor=>'se');