I am on Windows 10, and I am using Win32::GUI module to create a GUI-based application. The problem is, when I tried to use the Animate method (which is a common method) with a label, only the top left part of the label was applied to the animation. I had tried to change the size of the label but, the affected area was always at the top left corner, and the ratio of the affected area with respect to the whole label area seemed to remain the same.
Here is the code, when we press the button, the animation will be applied to the label:
use strict;
use warnings;
use Win32::GUI();
my $mainWindow = new Win32::GUI::Window(
-name => 'mainWindow',
-title => 'sample window',
-size => [1200, 800],
-minsize => [1200, 800],
-onTerminate => sub { return -1; },
);
$mainWindow->AddLabel(
-name => 'label1',
-text => 'string in label 1',
-background => 0x00ff00,
-size => [500, 300],
-pos => [300, 300],
);
$mainWindow->AddButton(
-name => 'b1',
-text => 'label 1',
-pos => [100, 0],
-onClick => sub {
$mainWindow->label1->Animate(
-show => !$mainWindow->label1->IsVisible(),
-activate => 1,
-time => 600,
-direction => 'lr',
-animation => 'roll',
);
},
);
$mainWindow->Show();
Win32::GUI::Dialog();
Why is that and how to solve it?
Btw, I also couldn't use any direction other than 'lr' and 'tb'.