my $ProgressWindow = new Win32::GUI::DialogBox(
        -name   => "ProgressWindow",
        -left   => 300,
        -top    => 300,
        -width  => 400,
        -height => 100,
        -title  => "Loading file...",
);

$ProgressWindow->AddProgressBar(
        -name   => "PB",
        -left   => 20,
        -top    => 25,
        -width  => 350,
        -height => 20,
        -smooth => 1,
);

$ProgressWindow->PB->SetPos(10);

sub ProgressWindow_Terminate
{
        $ProgressWindow->Hide();
        $ProgressWindow->PB->SetPos(0);
        return 0;
}


$ProgressWindow->PB->SetRange(0,$size);  ### I Set $size to the filesize
(upto 65535 max)
$ProgressWindow->Show();

while (something)       ### HERE's WHERE YOU OPEN THE FILE. DEPENDING UPON
HOW 
                        ### YOU WANT TO DO THE UPDATE WILL DETERMINE THE
while STATEMENT
{
        $linecount++;
        $ProgressWindow->PB->SetPos($linecount);
}

$ProgressWindow->Hide();



### Hope that helps.
### Pete


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 06, 2001 4:48 AM
To: [EMAIL PROTECTED]
Subject: [perl-win32-gui-users] Progress Bar


Does anyone have any example code for displaying a Progress Bar while a
program
executes for instance:

I have the program:

$prog     = "C:\\Progra~1\\winzip\\wzzip.exe -u -p -r -es -whs $archive
$source";

While I execute $prog I would like a status bar to display the progress and
hide() when complete.

Regards

Daryll





The information in this e-mail and any attachments is confidential and may
be
legally privileged. It is intended solely for the addressee or addressees.
If
you are not an intended recipient, please delete the message and any
attachments
and notify the sender of misdelivery: any use or disclosure of the contents
of
either is unauthorised and may be unlawful. All liability for viruses is
excluded to the fullest extent permitted by law. Any views expressed in this
message are those of the individual sender, except where the sender states
them,
with requisite authority, to be those of a specific LAZARD company or
partnership.



_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users

Reply via email to