I'm not following exactly what you mean, but here is the code I'm currently using. Your original code worked also, but the toggle seemed weird.
$mainWindow->AddButton
(
-name => 'b1',
-text => 'label 1',
-pos => [100, 0],
-onClick => sub {
$mainWindow->label1->Hide;
$mainWindow->label1->Animate
(
-show => 1, # !$mainWindow->label1->IsVisible(),
-activate => 1,
-time => 600,
-direction => 'brtl',
-animation => 'roll',
);
},
);
So that you can compare, I'm using the latest perl and modules available from cygwin on windows 11. Perl 5.36.3, Win32::GUI v1.14.