Re: Combo box from Glist without popdown_strings



The generic way to create a combo box is to construct a TreeModel and use it to populate the combo box. However, if you just want a list of strings in your combo box, you can use gtk_combo_box_new_text to create it, and gtk_combo_box_append or gtk_combo_box_insert to populate it.

See,
http://developer.gnome.org/doc/API/2.0/gtk/GtkComboBox.html

-Chris


Karl D. Middlebrooks wrote:
Alright, I'm pretty baffled on this one. I'm new to GTK/glib and am using the latest versions of each (2.4, if I recall correctly).

I'm trying to populate a gtk_combo_box_entry_new_text with the items from a Glist (a list of directories that I've gone and gathered up to present to the user).

However, since gtk_combo_set_popdown_strings appears to be deprecated (I get a warning about an implicit declaration of that function when I compile with it), I'm not at all sure how to build the list.

I've been trying to do something like: g_list_foreach(glist, (GFunc) gtk_combo_box_append_text(gtk_combo_box_set_active(combo), (gchar *)glist),NULL);

but a couple of errors when I try and compile this. The errors aren't terribly interesting, as I don't have a lot of confidence that this is even the right approach.

Any help getting me straightened out on this would be appreciated.

Karl D. Middlebrooks

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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