Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by Danny (Hermit)
on Aug 11, 2024 at 14:32 UTC ( [id://11160995]=note: print w/replies, xml ) Need Help??


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

I just installed Win32::GUI and this seems to be working ok for me. It just redraws the green rectangle with the text at the top left from left to right. Btw, I changed mine with a $mainWindow->label1->Hide; before the animate call and used -show => 1, in the Animate call so that it just redraws every time you click the button instead of toggling every other time. It also worked from bottom to top and right to left for me (and probably other combos). I'm doing this under cygwin.
  • Comment on Re: Object isn't fully affected by the Animate method in Win32::GUI module
  • Download Code

Replies are listed 'Best First'.
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

    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?

      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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-10-08 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (44 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.