in reply to Re^2: Perl Tk Asynchronous Progress Updates
in thread Perl Tk Asynchronous Progress Updates
I think that you may be missing the focus of kcott's post.
It is the repeat function.
Obviously, you start the progress bar when you are ready.
Example
use Tk; use Tk::ProgressBar; my $mw = MainWindow->new(); my $per = 0; $mw->ProgressBar(-variable=>\$per)->pack; $mw->Button(-text=>"Go",-command=>\&GoForIt)->pack; MainLoop; ######### This is the important bit ########### sub GoForIt { $mw->repeat(25=>sub{$per+=10;return if $per>100;;$mw->update;sleep +(1)}) }
In Section
Seekers of Perl Wisdom