Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Updating Tk window in real time

by TGI (Parson)
on Jul 21, 2005 at 21:23 UTC ( [id://477019]=note: print w/replies, xml ) Need Help??


in reply to Updating Tk window in real time

You need to set up a routine to call get() after you have run MainLoop(). The easiest way to manage that is to schedule it with after().
# Delete this from your code: #for ( 0 .. 54 ) #{ # get($_); # last if ($_ == 53 ) #} # Replace with: # Make a closure with $counter. { my $counter = 1; $fetch_data_point = sub { get($counter++); #collect a data point $mainwindow->after(100, $fetch_data_point) unless $counter > 5 +4; # schedule the next run, if necessary. }; } $mainwindow->after(100, $fetch_data_point ); # wait 100 ms then call +function ref.


TGI says moo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-26 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found