To illustrate my comments made in the comments, let me post a quick'n'dirty PyGtk example that uses GtkDrawingArea
to create a canvas and draw it with cairo
CORRECTION : you said PyGObject, i.e. Gtk + 3, so the example looks like this (the main difference is that there is no expose
event, instead it draw
and cairo context is already passed as a parameter):
source share