NewMonkMark has asked for the wisdom of the Perl Monks concerning the following question:
use Tk; my $MW = MainWindow->new(); ... ... $REFRESH{xyz} = \&xyz; ... # The "wait routine" { my ($WidRFR) = $REFRESH{$ID}->(); # Call the function while($CTRL_REFRESH < 1) { select(undef,undef,undef,0.1); } # this + waits until the var changes # Do some stuff } ... # The routine with the repeat Object sub xyz{ my $RFR = $MW->repeat( 500, sub{ { $CTRL_REFRESH = 1; # Do some stuff.... if(...) { $CTRL_REFRESH = 2; } # This is to notify the end o +f the work and it Works } } ); return($RFR); # Pass the object to the caller to make it able to d +estroy it }; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl/Tk repeat method, callback doesn't work if...
by zentara (Cardinal) on May 16, 2011 at 15:02 UTC | |
by NewMonkMark (Initiate) on May 17, 2011 at 08:40 UTC | |
by NewMonkMark (Initiate) on May 17, 2011 at 09:34 UTC | |
by zentara (Cardinal) on May 17, 2011 at 16:50 UTC | |
by NewMonkMark (Initiate) on May 19, 2011 at 16:39 UTC | |
by zentara (Cardinal) on May 19, 2011 at 18:10 UTC |