in reply to Re: Perl Tk exit the main window after 5 seconds...
in thread Perl Tk exit the main window after 5 seconds...

Thanks your replay.... I have clicked the ok button then the yes/no dialog box is opened and this program exit with some necessary data? how to destroy the message box also.
  • Comment on Re^2: Perl Tk exit the main window after 5 seconds...

Replies are listed 'Best First'.
Re^3: Perl Tk exit the main window after 5 seconds...
by Anonymous Monk on Aug 09, 2010 at 13:06 UTC
    sorry.. unnecessary data.
      The problem is messageBox is a special kind of window that grabs the screen. If you make it a transient, as shown below, it works, but some Tk errors will get printed as you destroy the mainwindow, because the messagBox still has a screen grab. If the below changes are not workable for you because of the Tk dump of destroy errors, then consider using a plain toplevel window instead of a messageBox.
      my $status = $mw -> messageBox( -message=>"Do u want to start the process..?", -type=>'yesno',); if($status eq "Yes") { $choice = "Yes"; print "$choice\n"; exit; }else{ $choice = "No"; } } ) -> pack(-side =>'right',-expand => 0); $status->transient($mw); # will work, but causes harmless errors repo +rted

      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku