Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Perl Tk Asynchronous Progress Updates

by Sandy (Curate)
on Jul 02, 2013 at 17:23 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-23 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found