Le mercredi 24 septembre 2008 à 20:55 +1000, Steve Smith a écrit :
> Sounds good, thanks. Would you attach this to the Stage gobject or the actor?
>
> Cheers,
> Steve
>
> On Wed, Sep 24, 2008 at 8:45 PM, Pierre-Luc Beaudoin
> <[EMAIL PROTECTED]> wrote:
> > 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
> >
> >
Actually, that's not clear from what I gave you, but you can call
idle_add directly on "gobject":
import gobject
if __name__ == '__main__':
#here or anywhere else btw
gobject.idle_add(on_idle, data)
def on_idle(self, data):
#do something
--
To unsubscribe send a mail to [EMAIL PROTECTED]