in reply to Updating Perl/Tk Canvas based on network input

I'm having problems figuring out where to bind any callbacks to widgets/objects so that I can redraw/adjust my lines/rectangles/text.

Look how I did it in Tk Realtime data aquisition

P.S. In Tk, you can always run little timers, that will auto refresh the canvas at a specified interval, like every 10 ms. Then all you need to do, is receive your data into an array, which the update sub would read from. 10 ms is very fast for human eyes to perceive, so it looks smooth.


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: Updating Perl/Tk Canvas based on network input

Replies are listed 'Best First'.
Re^2: Updating Perl/Tk Canvas based on network input
by fx (Pilgrim) on Nov 15, 2010 at 12:14 UTC

    Ah yes, Tk::after seems to have sorted it. The "repeat" call as the one I was looking for. I had looked (very quickly, admittedly, and without much gusto to be honest...) for a class or function called "timer" in the Tk docs but the (IMHO) bizarre naming of Tk::after had led me to overlook it.

    However, Tk::after now in place and all working well. I now have a series of bars going up and down for pretty pictures!! :)

    fx, Infinity is Colourless