[Glade-users] glade mystery

Michael Koppelman michael@aps.umn.edu
23 Jun 2003 19:41:34 -0500


Thank you for your reply.

The glade file has this line in it:

<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">

While troubleshooting this I recompile and reinstalled everything from
scratch using the latest stable versions. I know for a fact I am linking
against the latest glib, gtk, etc. 

Nothing I do has changed this situation. If I build my code with a fresh
glade-2 against fresh everything else, I get the errors below.

Can anyone explain why I get this damn GTK_IS_LABEL assertion failure
when GTK_OBJECT is changed to G_OBJECT? As to why it changed from
GTK_OBJECT to G_OBJECT I wouldn't really care if it worked. The glade
file has the labels in question clearly defined as being of class
GtkLabel.

Thanks!
Michael Koppelman


On Wed, 2003-06-18 at 04:24, Rikke D. Giles wrote:
> Hello,
> 
> Check the versions under which the glade file was written (the actual 
> glade version) and the one you are building the code with.  Most likely 
> they are not the same.  G_OBJECT came into use with gtk2.  If you run 
> autogen.sh and have say, a redhat system,  it'll work because it has 
> both gtk1 and gtk2 on it and the dependencies are satisfied.  However, 
> glade2 will not generate the proper code for gtk1.  Hope this makes 
> sense,
> 
> Cheers,
> 
> Rikke
> 
> On 2003.06.17 22:00, Michael Koppelman wrote:
> > I'm stumped. I have a glade file. It hasn't changed in the last 12
> > days
> > according to CVS. I have been working on callbacks over those days and
> > haven't messed with the GUI. If I do a fresh CVS checkout of the
> > project
> > and run ./autogen.sh; make and then run my app it works perfectly.
> > 
> > Now I open the Glade file (with the same version/install), change
> > nothing and have it build the sources. Now when I run the app I get:
> > 
> > (cspec:3204): Gtk-CRITICAL **: file gtklabel.c: line 937
> > (gtk_label_set_text): assertion `GTK_IS_LABEL (label)' failed
> > 
> > It fails on a call to gtk_label_set_text.
> > 
> > Inspection of the changes in the files reveals that in interface.c
> > this:
> > 
> > #define GLADE_HOOKUP_OBJECT(component,widget,name) \
> >   gtk_object_set_data_full (GTK_OBJECT (component), name, \
> >     gtk_widget_ref (widget), (GtkDestroyNotify) gtk_widget_unref)
> > 
> > 
> > 
> > #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
> >   gtk_object_set_data (GTK_OBJECT (component), name, widget)
> > 
> > 
> > ...has been changed to this:
> > 
> > #define GLADE_HOOKUP_OBJECT(component,widget,name) \
> >   g_object_set_data_full (G_OBJECT (component), name, \
> >     gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
> > 
> > 
> > 
> > #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
> >   g_object_set_data (G_OBJECT (component), name, widget)
> > 
> > 
> > If I change these definitions back, it works fine.
> > 
> > My question is: why is this happening? For some reasons it is using
> > G_OBJECT in the macro instead of GTK_OBJECT. There are similar changes
> > in support.c. As I said the glade file, glade itself, glib and all the
> > other libs have not changed. Any ideas?
> > 
> > Thanks!
> > Michael Koppelman
> > 
> > 
> > _______________________________________________
> > Glade-users maillist  -  Glade-users@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/glade-users
> >