Le mercredi 24 septembre 2008 à 20:39 +1000, Steve Smith a écrit : > Hi, > > I'm working on simple scrolling-graph app in Python with Clutter and > Cairo. The scolling works by sliding a Cairo texture across with a > simple Path Behaviour and once it reaches the end returns it to the > start and redraws the graph shifted with new data appended to the end. > > The problem is that the time taken to redraw the Cairo texture causes > a visible pause on all but the fastest machines. The obvious method > to avoid this is to draw the next texture in the background while the > first is scrolling and then flip them at the end (double-buffering > basically). I /could/ do this in a separate thread but I'd rather > avoid this and was wondering if there is a better method of utilising > idle time in the background? Any tips would be appreciated. > > Thanks, > Steve
Hi Steve, Have a look at gobject.idle_add(fct, data). fct is a function called on idle, which is basically what you are asking for. I used it to load images when idle and not stop the animations. Pierre-Luc -- To unsubscribe send a mail to [EMAIL PROTECTED]
