in reply to TK Progress Bar

There is also Tk::ProgressIndicator which may be a bit simpler.
#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::ProgressIndicator; my $MainWindow = MainWindow->new(); my $total = 100; # this will vary my $ProgressIndicator = $MainWindow->ProgressIndicator ( '-current' => 0, '-limit' => 100, # this is fixed! '-increment' => 1, '-height' => 20, '-width' => 400 )->pack; foreach my $offset (0..$total) { $ProgressIndicator->configure ('-current' => $offset*100/$total,) +; $MainWindow->update; } MainLoop;

Replies are listed 'Best First'.
Re: Re: TK Progress Bar
by Anonymous Monk on Aug 11, 2003 at 08:42 UTC
    This is a gorgeous bit of code, I am sure I will be using it as much as the "use strict". Thanks a lot.