Re: Gtk Combo box question



GList *items = NULL;
GtkWidget *combo;
gchar *buffer[20];
..
..
..

for (i=0;i<5;i++)
{
sprintf (buffer, "%d", i);

// probably something is missing here ?

items = g_list_append (items, buffer);
}

combo = gtk_combo_new ();
gtk_combo_set_popdown_string (GTK_COMBO (combo), Items);


See the working example below, everything looks fine to me, expect
the last s in gtk_combo_set_popdown_string[s] and the gtk_entry_set_text
that is missing in your code.
Carlos

-----------------------------------------------
combo = gtk_combo_new ();
gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (combo)->entry), "1.0");
glist = g_list_append (glist, "1.0");
glist = g_list_append (glist, "2.0");
glist = g_list_append (glist, "3.0");
gtk_combo_set_popdown_strings (GTK_COMBO (combo), glist);
gtk_widget_show (combo);




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