[cairo] PyCairo and graphics flicker:

Jeremy Moles jeremy at emperorlinux.com
Mon Dec 19 06:17:20 PST 2005


Rather than try and figure out what GTK is doing differently, I've just
decided to issue redraw messages via queue_draw() and be done with
it. :) I'm guessing GTK is doing some double buffering underneath the
hood, but I wasn't/still not sure.

On Fri, 2005-12-16 at 21:01 -0500, Jeremy Moles wrote:
> I'm writing an application using PyGTK/PyCairo and I had a quick
> question about some pseudo-animation I'm trying to implement.
> 
> If I do something like the following:
> 
> 	gobject.timeout_add(2000, CairoContextInstance.Render)
> 
> ...I can force the context to repaint itself every 2 seconds. However,
> when I do it this way, I get a very visible screen flicker.
> 
> ON THE OTHER HAND...
> 
> If I bind that same render function to the "expose" event (so that it
> redraws itself whenever GTK asks it to), everything is much smoother.
> The function is called perhaps 5-10 times per second, and there is never
> any visible flicker.
> 
> What is GTK doing that I'm not? :) Is the wrong place to be asking this
> question?
> 
> Thanks in advance...
> 
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo



More information about the cairo mailing list