Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Perl Tk Asynchronous Progress Updates

by Sandy (Curate)
on Jul 02, 2013 at 17:23 UTC ( #1042069=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1042069]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2021-11-30 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?