in reply to Re^2: MessageBox before mainloop problem
in thread MessageBox before mainloop problem
#!/usr/bin/perl use warnings; use strict; use Tk; my $test = shift || 0; my $mw = MainWindow->new; $mw->withdraw; my $count = 0; $mw->Button( -text => "hello", -command => sub { print $count++,"\n"; } )->pack; if ( $test == 0 ) { my $answer = $mw->messageBox( -icon => 'question', -message => 'Hello World!', -title => 'My title', -type => 'Ok' ); $mw->deiconify; } else { $mw->deiconify; } MainLoop;
|
|---|