Hi
marioroy, I'm glad to see someone use Prima, as it is an under-appreciated toolkit. I did notice one
unusual aspect of running your code. On my linux system, slackware, I notice a flickering in the $btn1 text as the background process runs. It almost looks like a "feature", indicating which step is active. :-)
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;
}
}
);