[Glade-users] something going wrong with ComboBoxEntry

nephish nephish at xit.net
Thu Aug 17 12:06:50 EDT 2006


Tristan Van Berkom wrote:

> 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.
>
>
oh, because i don't really know what i am doing. Thanks for answering 
though, and the link, i just subscribed.

cheers!
shawn


More information about the Glade-users mailing list