[pygtk] How to call methods with output parameters using gobject introspection?

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 22 16:28:43 WST 2011


How are you supposed to call the PangoLayout.get_pixel_size()
method using gobject introspection?

The C signature is

void pango_layout_get_pixel_size(
   PangoLayout *layout, int *width, int *height);

Using the old Python bindings, you called it with no parameters
and it returned a 2-tuple.

But the gi version seems to expect 2 parameters and returns
None. What's more, it seems to expect them to be *numbers*.

Since most numbers in Python are immutable, how the heck
is this supposed to work?

-- 
Greg


More information about the pygtk mailing list