in reply to Re: Die vs. Exit
in thread Die vs. Exit
#!/usr/bin/perl use warnings; use strict; use Tk; require Tk::ErrorDialog; my $mw = new MainWindow; $mw->title("Close test"); $mw->geometry("400x250"); #prevents mw from closing $mw->protocol('WM_DELETE_WINDOW' => \&save_it ); $mw->after(2000, sub{ die } ); MainLoop; sub save_it { print "do stuff here before the exit\n"; $mw->messageBox(-message=>"you tried to exit!"); }
|
|---|