Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Updating Tk window in real time

by TGI (Parson)
on Jul 21, 2005 at 21:23 UTC ( #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? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2022-10-03 14:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (14 votes). Check out past polls.

    Notices?