[Glade-users] Glade 3 COmbo Entry Boxes



On Mon, 2009-01-12 at 13:04 -0600, mstute wrote:
I done a lot of research on this, including this lits but I have yet to
find exactly how to add items to a GtkComboEntry box. I've heard that if
you add an entry to them "Items" list it will use gtk_combo_box_new_text
() to create the widget but this doesn't seem to work.

Anybody have code for it or a good tutorial? What's the best signal to
ctach if you want to populate before it is displayed? realize?

Based on my experience, the most flexible way to do it is using a tree
model. The sequence would be like this:
1. create appropriate model, say with gtk_list_store_new ()
2. attach the model to the combo box with gtk_combo_box_set_model ()
3. tell the combo box which column to pull the data from with
gtk_combo_box_entry_set_text_column ()

You can populate and manipulate your model at any time then.




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