[cairo] Pycairo issues

Gustavo J. A. M. Carneiro gjc at inescporto.pt
Thu Jul 6 09:24:55 PDT 2006


On Qua, 2006-07-05 at 22:18 -0400, Eduardo Silva wrote:
> Mi name is Eduardo, I'm writing from Chile. 
> 
> I have a problem with a simple drawingarea :
> 
> In the expose event I drawed a rectangle with a blue color and then a
> grid. When I push a button (gtkbutton), this call a
> gobject.timeout_add(...) method and the callable method start to draw
> a simple line every 500ms, that's working fine until the expose event
> appears: move the window, minimize, etc. the expose event redraw all
> that I have and it create a new context, but the function that's
> working from gobject.timeout_add(...) can't draw in the context,
> functions like move_to and line_to say that all is ok but I don't know
> what happens because nothing is drawed again.

  Tips:
	1. draw only from expose event
	2. always create a new cairo context from inside the expose event
handler
	3. don't draw from the timeout handler; instead, call
draw_area.queue_draw() and let the expose event be generated.

  Example: http://www.gnome.org/~gjc/merrychristmas.py

> 
> ideas??
> 
> best regards.
> 
> Eduardo Silva
> Valparaiso - Chile 
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
-- 
Gustavo J. A. M. Carneiro
<gjc at inescporto.pt> <gustavo at users.sourceforge.net>
The universe is always one step beyond logic.



More information about the cairo mailing list