http://qs1969.pair.com?node_id=1042069


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)}) }