Hi,
I created a Window with combo box on.
Glade build the interface.c file with these declarations :
GtkWidget *SelectMGW;
GList *SelectMGW_items = NULL;
and initalizations :
SelectMGW = gtk_combo_new ();
gtk_widget_ref (SelectMGW);
gtk_object_set_data_full (GTK_OBJECT (MainWindow), "SelectMGW",
SelectMGW,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (SelectMGW);
gtk_table_attach (GTK_TABLE (table1), SelectMGW, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
SelectMGW_items = g_list_append (SelectMGW_items, "First");
SelectMGW_items = g_list_append (SelectMGW_items, "Second");
gtk_combo_set_popdown_strings (GTK_COMBO (SelectMGW), SelectMGW_items);
g_list_free (SelectMGW_items);
combo_entry2 = GTK_COMBO (SelectMGW)->entry;
gtk_widget_ref (combo_entry2);
gtk_object_set_data_full (GTK_OBJECT (MainWindow), "combo_entry2",
combo_entry2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (combo_entry2);
gtk_entry_set_text (GTK_ENTRY (combo_entry2), "First);
Now in my main.c I would like to add items to my combo box before showing
my Main Window (The items depends on a configuration file)
For now I have :
MainWindow =create_MainWindow();
gtk_widget_show (MainWindow);
I would like to do :
MainWindow =create_MainWindow();
ChangeItems(MainWindow);
gtk_widget_show (MainWindow);
I understand I have to add items to the SelectMGW_items list, may be just
like SelectMGW_items = g_list_append (SelectMGW_items, "Third");
But from main.c I need to know the pointer SelectMGW_items.
I tried to get it by using the lookup_widget, but it doesn't work (I gues
because it is a Glist not a GtkWidget).
So is there anybody to help me.
Thanks
Philippe
_______________________________________________
Glade-devel maillist - [EMAIL PROTECTED]
http://lists.helixcode.com/mailman/listinfo/glade-devel