Just making sure I have this right....
A script that might look like this:
use Tk; my_long_sub { print "You can't kill me!\n"; sleep 60; my_long_sub(); } $main = MainWindow->new; $main->Button( -text "Start Long Sub", -command \&my_long_sub)->pack;
Could (and should?) be written thusly:
use Tk; $seconds = 60; not_a_long_sub { print "You can't kill me!\n"; #sleep 60; <-Replacing this with an after #my_long_sub(); <-After handles the call } $main = MainWindow->new; $main->Button( -text "Start Long Sub", -command \¬_a_long_sub)->pac +k; $main->after($seconds * 1000, \¬_a_long_sub);
This assumes the after counts in Milliseconds. (Like Tk)
Sorry to work this out in public, but I wanted to get my brain around it quick.... If anyone gathers the notion that I havent grokked this fully, let me know.
In reply to Re: Re: Perl TK
by HamNRye
in thread Perl TK
by HamNRye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |