In place of exit;, try $tk_win->destroy;.
#!/Perl/bin/perl -w use strict; use Tk; my $filename; my $tk_win = MainWindow->new; my $name_entry = $tk_win->Entry->pack; $tk_win->Button(-text=>'Prepare It!', -command=>\&getFilename)->pack; MainLoop; print "Outside the MainLoop now!\n"; print "filename is $filename\n"; sub getFilename { $filename = $name_entry->get; $tk_win->destroy; }
In reply to Re: Quit Tk but continue with script... is it possible?
by Mr. Muskrat
in thread Quit Tk but continue with script... is it possible?
by Grygonos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |