Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use Tk; use Tk::ProgressBar; my $percent_done = 0; my $i = 0; our $mw = MainWindow->new(-title => 'ProgressBar example'); my $progress = $mw->ProgressBar( -variable => \$percent_done )->pack(- +fill => 'x'); $mw->Button(-text => 'Go!', -command=> sub { for ($i = 0; $i < 1000; $i++) { $percent_done = $i/10; $mw->update; # otherwise we don't see how far we are. } })->pack(-side => 'bottom'); $mw->Button(-text => 'Exit!', -command=> sub {$mw->destroy;} )->pack(-side => 'bottom'); MainLoop;
2005-04-06 Janitored by Arunbear - added code tags, as per Monastery guidelines
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bizarre copy of ARRAY in leave at ...
by NateTut (Deacon) on Apr 06, 2005 at 21:01 UTC | |
by mnooning (Beadle) on Apr 07, 2005 at 01:42 UTC |