[pygtk] Writing python bindings, getting pygobject_new_full assertion failed error. Need assistance.
John Stowers
john.stowers.lists at gmail.com
Mon Dec 14 22:34:28 WST 2009
On Sun, 2009-12-13 at 11:17 -0500, Adam Plumb wrote:
> Hallelujah! After days of agony and frustration I finally figured
> this out.
>
> I'm using the pygobject h2def.py script to generate my .defs file from
> the thunarx header files, and for all my object definitions (i.e.
> ThunarxMenuProvider, etc), it was using the define-object call. But
> apparently, it needs to use the define-interface call, because once I
> changed it to define-interface, everything worked perfectly. I only
> noticed this after looking at the nautilus-python's generated
> nautilus.c file, which was calling pyg_register_interface() rather
> than the pygobject_register_class() function all my objects were
> using. I then looked at the nautilus defs file and it was using the
> define-interface call rather than the define-object call. Changing
> "object" to "interface" fixed it for me.
>
> Is this a bug in h2def.py? Can someone explain it to me?
You should not trust the output of h2def.py completely.
Every binding I have ever made has required some small hand modification
of the defs file generated by h2def.py.
John
More information about the pygtk
mailing list