#prevents mw from closing and iconifies instead $mw->protocol('WM_DELETE_WINDOW' => sub { $mw->iconify }); #### tksleep($mw, 100); sub tksleep { # Like sleep, but actually allows the display to be # updated, and takes milliseconds instead of seconds. my $mw = shift; my $ms = shift; my $flag = 0; $mw->after($ms, sub { $flag++ }); $mw->waitVariable(\$flag); }