[Glade-users] something going wrong with ComboBoxEntry



nephish wrote:
[...]

# populate the Sensor Type list
self.new_list_store = gtk.ListStore(str)
new_cell = gtk.CellRendererText()
self.SensorTypeEntry.pack_start(new_cell)
self.SensorTypeEntry.add_attribute(new_cell, 'text', 0)
type_list = gDDS.getMany("SELECT `Type` FROM `Status_Def` \
  ORDER BY `Type` + 1") # object that wraps sql query & returns tuple
for type_def in type_list:
   self.new_list_store.append([type_def[0]])
   self.SensorTypeEntry.set_model(self.new_list_store)
   self.SensorTypeEntry.set_text_column(0)

any ideas ?
 


I cant say I really understand this code, but from first sight
I wonder, why would you set the GtkTreeModel to `new_list_store'
every time you append an entry to the liststore ?

Also, why would you call set_text_column() every time ?

Cheers,
                       -Tristan

Note: this is a list about the glade tool, you'll get better results
asking gtk+ related questions on gtk-app-devel-list at gnome.org.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]