[Glade-users] GtkComboBox in Glade 3.63, GtkBuilder mode

Alexey Kurochkin alexey.kurochkin at pathfinderlwd.com
Mon Apr 27 10:00:54 EDT 2009


On Sun, 2009-04-26 at 03:25 +0400, Саша Иваненко wrote:
> Hi.
> 
> I wonder how to use GtkComboBox box with a glade-created GtkListStore.
> I create GtkComboBox, create new model for it, fill model with several values of a single column(have tried different types). When I try to expand combobox control I see just small rectangle on top of the control. Am I missing something to get combo working properly?

You need to tell the combobox what column from the model you want to
show and how to show it. It is done with renderers (similar to the
treeview widget). Something like this for simple text from column #0:

GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (mycombobox), renderer,
TRUE);
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (mycombobox), renderer,
"text", 0);



More information about the Glade-users mailing list