[pygtk] gtkCombo box problem

John Finlay finlay at moeraki.com
Tue Jun 13 04:20:23 WST 2006


Peter Morgan wrote:
> Am a bit of a newbie.. but getting an unexpected error...
> when comboBox. set_active() is called and it doesn't select one of the 
> dropdowns
>
> GtkWarning: gtk_entry_set_text: assertion `text != NULL' failed
> combo.set_active(1)
>
>
>
>
>      ##colTypes
>      selectMe = 'int(11)'
>      self.colTypesStore = gtk.ListStore(str)
>      self.colTypesStore.append( ['varchar(20)'])
>      self.colTypesStore.append( ['int(11)'])
>      self.colTypesStore.append( ['timestamp'])    combo = 
> self.wTree.get_widget('editColTypes'); # combo = gtkComboBox from Glade
>      combo.clear()
>      combo.set_model(self.colTypesStore)
>      print len(self.colTypesStore)
>      cell = gtk.CellRendererText()
>      combo.pack_start(cell, True)
>      combo.add_attribute(cell, 'text', 0)
>      combo.set_active(1)
>
>
> Can anyone shed some light on what I'm doing wrong
It appears that you are using a ComboBoxEntry and therefore need to call 
the set_text_column() method as well.

John


More information about the pygtk mailing list