This is modified example from Stephen Pick.
I replaced while(1) by Timer-Method. The ProgressBar
dont work with Timer. Have I made a mistake?
Or I can call ProgressBar only inside main loop?
#!perl -w
use strict;
use Win32::GUI;
my $window = new Win32::GUI::Window(
-name => "main",
-text => "Status Progress",
-size => [300,300],
-pos => [100,100],
);
$window->AddLabel( -name=>'test',
-pos=>[10,10],
-size=>[100,100]
);
my $status = new Win32::GUI::StatusBar($window);
$status->Parts(200,-1);
my $progress = new Win32::GUI::ProgressBar($status, -smooth => 1);
$progress->SetRange(0,50);
$progress->SetPos(25);
my $t1 = $window->AddTimer('T1', 1000);
$window->Show;
Win32::GUI::Dialog();
sub T1_Timer{
my $random = int rand (50);
$progress->SetPos($random);
$window->test->Text($random);
}
sub main_Terminate{
return -1;
}