First, Tk::repeat is a quick shortcut for Tk::after, read "perldoc Tk::after". Look thru Tk::after's methods to see if there is something you can use. Second, you didn't show a complete code example, but with Tk timers, if you declare them BEFORE you create them, you can use their variable name within the callback, like:
#pseudocode my $timer; # code update line below, I forgot to define $timer $timer = $mw->repeat( 50, { #you can use $timer here if $whatever, $timer->cancel; } ); # declare outside the callback, otherwise a $timer cannot cancel itsel +f
If you really want to get into a select style usage, within Tk, it dosn't work well, because it will interfere with the eventloop. But there is a workaround. See Tk::Trace in Simple Tk Gauge
In reply to Re: Perl/Tk repeat method, callback doesn't work if...
by zentara
in thread Perl/Tk repeat method, callback doesn't work if...
by NewMonkMark
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |