use Tk;
my $mw = MainWindow->new;
$mw->Label(-text => "Foo")->pack;
$mw->after(2000, sub {exit});
MainLoop;
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] [d/l] |
shmem's answer is exactly correct.
However, because I've encountered this at various times, I'd like to share another point that sooner or later might be useful to whomever.
When you simply want the MainLoop to finish, and continue executing code after it, you don't want to exit, but instead kill the MainWindow:
$mw->after(2000, sub { $mw->destroy });
MainLoop;
warn "MainLoop ended; continuing...\n";
A word spoken in Mind will reach its own level, in the objective world, by its own weight
| [reply] [d/l] |
Thanks everyone for their collective wisdom in solving my problem.
| [reply] |