Howdy,
I wonder if anyone else has seen this.
(I'm very new to Win32::GUI so this is likely self inflicted.)
I have a non-interactive script (no dialog phase) that is having
trouble sleeping when in loop. While decrementing a $count var in loop,
any movement of the mouse that falls within the bounds of the GUI window
makes each individual sleep function finish abruptly (so if I move my
mouse over window I fly through the loop).
(see code below)
Should I instead be using a timer for this perhaps???
TIA for any help,
-Jim
PS: Many thank to Mr. Calpini for this excellent module.
#===================================
#2 Areas of script in question (display and countdown loop):
<snip>
sub display { # Update status text
my $text=shift;
$aggregate=($aggregate."\n".$text);
$MW->Show();
$MW->BringWindowToTop();
#$MW->Refresh();
$MW->Status->Text($aggregate);
$MW->Status->Update();
$MW->Banner2->Text("My Organization");
$MW->Banner1->Text("My Dept");
$statuscount=$statuscount+$count;
$MW->PB->SetPos($statuscount);
Win32::GUI::DoEvents() >= 0 or die "Window was closed during
processing";
}
<snip>
#=====================================================================
<snip>
if ($patch eq "yes") { #3
$aggregate=("");
display (" UPDATE NEEDED!");
display(" ==============");
display (" Your computer is lacking an important security
update.");
sleep(4);
display (" In a few seconds this update will be installed on
this PC.");
sleep(4);
display (" NOTE: Your machine may have to reboot following the
install.\n");
sleep(4);
display (" Please make sure to close out of any programs and save
your work.\n");
sleep(10);
display ("Patch will install in 60");
for($count = 60; $count > 0; $count--) {
$aggregate=("");
display ("Patch will install in:".$count );
sleep 1;
}