Thanks for the help. I didn't want to post the whole script and clog the
list. Next time I will post the entire script.
--
Andy Pastuszak
Desktop Engineer II
Commerce Bank
[EMAIL PROTECTED]
(856)470-3270
Robert May <[EMAIL PROTECTED]>
05/05/2006 04:12 PM
To: Andrew M Pastuszak <[EMAIL PROTECTED]>
cc: [email protected]
Subject: Re: [win32-gui] [perl-win32-gui-users] Progress Bar Not
Displaying
Andrew M Pastuszak wrote:
> I am having a problem, with the progress bar not displaying in a window.
> Here is my subroutine. Feel free to offer any comments you want about
> cleaning up this code:
Without *short*, *complete*, and *runnable* code example that
demonstrates your problem it is very difficult to help. In making your
code example runnable I end up with something that runs fine.
Here's what I cut your code down to:
#!perl -w
use strict;
use warnings;
use Win32::GUI();
my $progress = Win32::GUI::Window->new(
-title => 'Conversion Progress',
-name => 'Progress',
-size => [450,125],
);
$progress->AddProgressBar(
-name => 'PB',
-size => [400,20],
-pos => [0,20],
);
$progress->AddStatusBar(
-name => 'SB',
);
$progress->PB->SetRange(0,100);
$progress->Center();
$progress->Show();
foreach (1 .. 100) {
$progress->PB->SetPos($_);
$progress->SB->Text("$_");
#Win32::GUI::DoEvents(); # See later in email
Win32::Sleep(100);
}
$progress->Hide();
exit(0);
__END__
As I said, it runs fine, and the progress bar is displayed. The only
thing that I can see that you might want to do is add a
Win32::GUI::DoEvents() call during the loop, so that all windows
messages get processed - otherwise things like paint messages are not
handled (try moving another window across the front of the progress
window, while it is running).
Regards,
Rob.
____________________________
This message and any attachments may contain confidential or privileged
information and are intended only for the use of the intended recipients of
this message. If you are not the intended recipient of this message, please
notify the sender by return email, and delete this and all copies of this
message and any attachments from your system. Any unauthorized disclosure,
use, distribution, or reproduction of this message or any attachments is
prohibited and may be unlawful.
____________________________