[pygtk] help with TreeStore

John Finlay finlay at moeraki.com
Sun Jun 11 06:35:20 WST 2006


Benjamin Montgomery wrote:
> I need some help with TreeStore.  I'm trying to add an object that is
> part of a module that I have written in C.  In my pygtk app I'm using:
>
> gtk.TreeStore(gtk.TYPE_STRING, ..., myobject)
>
> When this line gets executed, I get the error:
>
> TypeError: could not get typecode from object
>
> Does anyone know what I would need to add to my object to be able to put
> it in to a treestore?
>
>   
If it is a Python object and not a PyGTK GObject then use 
gobject.TYPE_PYOBJECT as the column type. gobject.TYPE_PYOBJECT will 
also work for PyGTK GObjects as well.

You might want to file a bug since I figure that TreeStore and ListStore 
should be able to accept an ordinary Python object as well.

John


More information about the pygtk mailing list