Glade3: Setting TreeModel in GtkComboBox



Im using Glade 3.6.7 and GTK+ 2.18.7, build UI with Glade and save as GtkBuilder format. I don't understand 
how GtkBuilder implements GtkComboBox's TreeModel, in Glade i already add it's model, create a column and 
append some entries. But i didn't see anything listed in that combo box (empty). I try to manually create 
it's TreeModel in codes and apply:

...
GtkTreeIter iter;

GtkWidget *combo = (GtkWidget*) gtk_builder_get_object (builder, "Combo1");
GtkListStore *store = gtk_list_store_new (1, G_TYPE_STRING);
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store));
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter, 0, "test", -1);
...

I still have an empty GtkComboBox. Did i miss something here?

                  - Ardhan



_____________________________________________________________
Listen to KNAC, Hit the Home page and Tune In Live! ---> http://www.knac.com



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