Odp: Gtk Combo box question



-----Wiadomość oryginalna-----
Od: Carlos Pereira <carlos pehoe civil ist utl pt>
Do: gtk-app-devel-list gnome org <gtk-app-devel-list gnome org>
Data: 20 czerwca 2001 22:55
Temat: 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);

This is only part of my code. I make all widget visible using
gtk_widget_show_all at the end of my mian function.



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

Thanks for the info. But I would like make appending to GList item
automatically using e.g. "for" loop.
-----------------------------------------------
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);

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


API SH/CD, 195/65R15 88H, HC/R 25 E1 02A 44457
        Dezorientujące symbole - zobacz, co oznaczają!
        http://parking.poland.com/zapraszamy/porady.asp





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