[cairo] Using Cairo functions intead of GDK functions

Emmanuel Thomas-Maurin manutm007 at gmail.com
Fri May 13 12:29:29 PDT 2011


Good day list!

In my gtk app, I'm currently replacing deprecated GDK code with Cairo
code and I have problems with the following:

(The code is inside a timeout handler that is called repeatedly and
involves drawing part of a GDK pixmap onto a drawing area.)

  /* gdk code */
  gdk_draw_drawable(GDK_DRAWABLE(drawing_area->window), gc, pixmap, \
	x, 0, 0, 0, drw_a_width, drw_a_height);

  /* cairo code */
  cr = gdk_cairo_create(GDK_DRAWABLE(drawing_area->window));
  gdk_cairo_set_source_pixmap(cr, pixmap, 0, 0);
  cairo_rectangle(cr, x, 0, drw_a_width, drw_a_height);
  cairo_fill(cr);
  cairo_destroy(cr);

The drawing area is now showing only the pixmap background color. So,
what am I missing?
Thanks for any hints.

-- 
Emmanuel Thomas-Maurin <manutm007 at gmail.com>


More information about the cairo mailing list