in reply to Prima + MCE::Hobo demonstration
Here is an unoptimized hack to fix the problem in the timer. It looks like this is a perfect opportunity to use a "state" variable in the timer, but this is just a brute force method, which makes it clear what is happening.
my $text = ''; my $timer = Prima::Timer->create( timeout => 100, onTick => sub { my $new_text = $msg->get; if ($new_text ne $text){ $btn1->set( text => $new_text ); $text = $new_text; } } );
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Prima + MCE::Hobo demonstration
by marioroy (Prior) on Apr 29, 2017 at 14:51 UTC |