Hi all, I also needed the liststore implementation of a Combo for a different reason (I could not find a way to to make the simple Combo tell me the number of items currently in the list. With a list store implementation this is simply n = gtk_tree_model_iter_n_children ( (GtkTreeModel *)store , NULL );).
I confirm what Tadej was mentioning... After moving the data into the liststore the following work for setting the active selection: GtkTreeIter iter ; char pathstring [ 20 ] ; sprintf ( pathstring , "%d" , selix ) ; gtk_tree_model_get_iter_from_string ((GtkTreeModel *)store, &iter, pathstring); gtk_combo_box_set_active_iter ((GtkComboBox *)c, &iter ) ; This works too: gtk_combo_box_set_active ((GtkComboBox *)c, selix ) ; Ken --- On Fri, 25/6/10, Tadej Borovšak <[email protected]> wrote: From: Tadej Borovšak <[email protected]> Subject: Re: gtkcombobox with self internal code to the options To: "John Williams" <[email protected]> Cc: [email protected] Date: Friday, 25 June, 2010, 2:39 AM Hi. > Shall I beg? Maybe you should attach a check to your mail. ;-) Seriously, sorry for this delay. gtk_combo_box_set_active() will work just fine. If you have iter, you can also use gtk_combo_box_set_active_iter(). Tadej -- Tadej Borovšak tadeboro.blogspot.com [email protected] [email protected] _______________________________________________ gtk-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtk-list
_______________________________________________ gtk-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtk-list
