monktim has asked for the wisdom of the Perl Monks concerning the following question:
When an event occurrs, I'm poping up a window that has a button. When I click the button I'd like to kill the window and continue processing.
How do I kill the window without killing the program? See sub ok below.
Thanks.
use strict; use warnings; use Tk; my $notified = 0; notify(); continue_processing(); exit 0; sub notify { my $win = new MainWindow; $win->Label(-text => 'Window!')->pack; $win->Button(-text => 'OK', -command => sub{ok()})->pack; Tk::MainLoop(); } sub ok { $notified = 1; Tk::exit(0); } sub continue_processing() { print "Here I am $notified\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Tk question
by batkins (Chaplain) on Nov 13, 2003 at 22:49 UTC | |
by graff (Chancellor) on Nov 14, 2003 at 06:04 UTC |
Back to
Seekers of Perl Wisdom