Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Object isn't fully affected by the Animate method in Win32::GUI module

by Anonymous Monk
on Aug 11, 2024 at 14:48 UTC ( [id://11160996]=note: print w/replies, xml ) Need Help??


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 (Hermit) 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11160996]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-09-10 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (7 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.