[Glade-users] (newbie) combobx and model



Hello,

I've 3 empty combobox(es) (GtkComboBox Class) built with glade.
I first try to append some text in my .c with :
gtk_combo_box_append_text
but have a lot of errors and no gui was visible :(

So I put a first item in the 'elements' section in the glade
interface, and append others with the same function in my .c. And it
works, I have  the gui visible but 6 errors appear in the console :
each combobox seem to generate two of them :

 (age:14244): Gtk-CRITICAL **: gtk_tree_row_reference_new: assertion
`GTK_IS_TREE_MODEL (model)' failed

(age:14244): Gtk-CRITICAL **: gtk_cell_view_set_displayed_row:
assertion `GTK_IS_TREE_MODEL (cell_view->priv->model)' failed

So, i looked on the internet, and found that i should use some 'model'
; as my list in each combobox is made of one single type, i see that i
should do this kind of thing :

 GtkListStore *l;
 GtkTreeIter iter;
  l=gtk_list_store_new(1,GTK_TYPE_INT);
  for(i=0;i<30;i++) {
    gtk_list_store_append(l,&iter);
    gtk_list_store_set(l,&iter,0,i+1,-1);
     ...

But, i don't know how to link this to my combobox !
I look in the glade interface, and i found a label 'Model' with an
entry but uneditable !... There's also a button [...] but it leads to
a window where there's no model available and i don't know how to put
one in this...

Thank you for any help.

-- 
Cordialement
                           David Cobac <http://dcobac.free.fr>




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