blackadder has asked for the wisdom of the Perl Monks concerning the following question:
I'm reading a list of remote servers (thousends of 'em!) off a .lst file and printing them on the screen (STDOUT) thats all (at the moment). I would to program a progress bar indicator for this opration. I did a search here on PM and read everything there is to read about progressbars which was very useful. In fact I even have managed to learn it propery but that was some time ago. I have been trying all day to get this thing working, but to no avail (maybe its a mental blockage)...:-(use strict; use warnings; use Tk; use Tk::ProgressBar; my $percent_done=0; my $mw = MainWindow->new(-title => 'Processing'); my $Progress = $mw->ProgressBar( -width => 30, -from => 0, -to => 100, -blocks => 50, -colors => [0,'blue',100,'blue'], -variable => \$percent_done )->pack(-fill => 'x'); open (LST, "c:\\list.lst")||die "$^E : $!\n"; chomp (my @data=<LST>); my $count = 0; for (@data) { print STDOUT "$_\n"; $percent_done = $count/10; $count++; $mw->update; } MainLoop();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Just another TK ProgressBar question!
by Ven'Tatsu (Deacon) on Sep 09, 2004 at 15:15 UTC | |
|
Re: Just another TK ProgressBar question!
by PodMaster (Abbot) on Sep 09, 2004 at 15:14 UTC | |
|
Re: Just another TK ProgressBar question!
by zejames (Hermit) on Sep 09, 2004 at 15:27 UTC | |
by Anonymous Monk on Sep 17, 2004 at 16:14 UTC |