[pygtk] Passing cairo_t and cairo_matrix_t as signals/properties

Robert Gibbs gibbsrc at gmail.com
Tue Mar 21 10:46:06 WST 2006


I have a C library that passes cairo types through GBoxed wrappers.  This of
course works fine for C; however, when I wrap the library for Python, there
appears to be no way to override the GBoxed type with the real PyCairo type.

Accessing one of these through the properties interface I get:

>>> print i.props.matrix
<GParamBoxed 'matrix'>

>>> m = cairo.Matrix()
>>> i.props.matrix = m
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: cannot set GOject properties without an instance

Likewise when attempting to override a signal:

    def do_paint(self, ct):
        print 'paint', ct, type(ct)

paint <CrContext at 0x8277330> <type 'gobject.GBoxed'>


I can write a conversion function for the .override file, but I would prefer
to have something cleaner.

Is there any way to do this?

Thanks
Bob Gibbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20060320/a05def81/attachment.htm


More information about the pygtk mailing list