[pygtk] gtkbuilder and glade - pygtk's object type
Laszlo Pandy
laszlok2 at gmail.com
Wed Jun 24 22:54:41 WST 2009
Try:
self.previewStore = gtk.ListStore( str, gobject.TYPE_PYOBJECT )
What type are you adding to your ListStore when it gives an error?
Laszlo
On Mon, Jun 22, 2009 at 3:49 PM, Mats
Taraldsvik<mats.taraldsvik at bickeringleague.net> wrote:
> Hi,
>
> I am trying to move an app from using libglade to the new gtkbuilder.
> However, when creating a TreeView and ListStore, I don't know how to
> handle an object ( as in a class object ) / what data type to use.
>
> With libglade I did this:
>
>
> self.previewStore = gtk.ListStore( str, object )
>
> self.previewView = self.wTree.get_widget("previewTree")
> self.previewView.set_model(self.previewStore)
>
> render=gtk.CellRendererText()
> col=gtk.TreeViewColumn("Original Name",render,text=0)
> col.set_resizable(True)
> self.previewView.append_column(col)
>
> col=gtk.TreeViewColumn()
> col.set_visible(False)
> self.previewView.append_column(col)
>
> self.previewView.show()
>
>
> However, I get a "TypeError: value is of wrong type for this column"
> when trying to add items. Works just fine if I remove the data/object
> column.
>
> Regards,
> Mats Taraldsvik
>
>
> _______________________________________________
> pygtk mailing list pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
More information about the pygtk
mailing list