in reply to Re: Object isn't fully affected by the Animate method in Win32::GUI module
in thread Object isn't fully affected by the Animate method in Win32::GUI module

The problem seems to be because it doesn't work with an object that was already shown. I tried to hide it at first, like you, and it worked well for showing, and it also worked for other directions. But if I add a button to hide it, it still suffers from the problem that I mentioned.

Here is the code for hiding button:

$mainWindow->AddButton( -name => 'b2', -text => 'label 1 hide', -pos => [150, 0], -onClick => sub { $mainWindow->label1->Animate( -show => 0, -time => 600, -direction => 'lr', -animation => 'roll', ); }, );

What should I do?

  • Comment on Re^2: Object isn't fully affected by the Animate method in Win32::GUI module
  • Download Code

Replies are listed 'Best First'.
Re^3: Object isn't fully affected by the Animate method in Win32::GUI module
by Danny (Chaplain) on Aug 11, 2024 at 14:57 UTC
    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.

      The image in this link: 'https://i.postimg.cc/yx8n5CBv/hide.png' is what I get when I click 'label 1 hide' button on the right. The showing process worked OK if I hide the label at first.

      I am using Strawberry Perl and Win32::GUI at the latest version

        I don't know why '-show 0' is only removing the top left of the green for you. I can't reproduce it. Compare your perl and Win32::GUI versions to those I posted as a first step. You could also install a temporary minimal cygwin to check if it's something other than your perl/modules.