in reply to Quit Tk but continue with script... is it possible?
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; }
|
|---|