Thanks again Claudio for taking the time to explain that to me. Much appreciated.
On 23/01/2008, Claudio Saavedra <[EMAIL PROTECTED]> wrote: > > El mié, 23-01-2008 a las 06:09 +1100, Peter E Dennis escribió: > > Thanks Claudio. > > > > I'm just wondering why do I use the GTK_COMBO_BOX macro and not the > > GTK_COMBO_BOX_ENTRY macro? > > Because gtk_combo_box_append_text () is a function that works on > GtkComboBox objects, not GtkComboBoxEntry ones. > > As GtkComboBoxEntry inherites from GtkComboBox, you can use functions > from the parent class in your GtkComboBoxEntry instance, but you need to > cast it, given that C can't do it itself. A little pain of using GObject > and C :-) > > Claudio > > > > > Many thanks, > > > > Peter. > > > > > > > > On 23/01/2008, Claudio Saavedra <[EMAIL PROTECTED]> wrote: > > > > > > El mar, 22-01-2008 a las 21:55 +1100, Peter E Dennis escribió: > > > > > > > > So I wondered if I needed to cast my GtkComboBoxEntry to a GtkComboBox > > > > but wasn't sure how to do this so I tried: > > > > > > > > gtk_combo_box_append_text(GTK_COMBO(cboVocSource), "Hello World"); > > > > > > > > This however makes matters worse as I get the above warning still when > > > > I compile it, but now when I run it I get: > > > > $ ./box > > > > > > > > (box:11338): GLib-GObject-WARNING **: invalid cast from > > > > `GtkComboBoxEntry' to `GtkCombo' > > > > > > > > Can someone please tell me what I'm doing wrong? > > > > > > You need to cast to a GtkComboBox, not to a GtkCombo. Use the > > > GTK_COMBO_BOX macro. > > > > > > Claudio > > > > > > -- > > > Claudio Saavedra <[EMAIL PROTECTED]> > > > > > > > > _______________________________________________ > > gtk-app-devel-list mailing list > > gtk-app-devel-list@gnome.org > > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list > > > -- > Claudio Saavedra <[EMAIL PROTECTED]> > > _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list