[Gtk-sharp-list] Some problem with IconSize enum

Mike Kestner mkestner@ximian.com
Mon, 17 May 2004 12:00:59 -0500


On Sat, 2004-05-15 at 19:37, Todd Berman wrote:

> > Ok, so it seems like the problem here is that the "stock_size" property
> > of GtkCellRendererPixbuf is stored as uint, which glib thinks is not
> > compatible with an enum. And the introspection that Gtk# uses causes it
> > to try and assign an enum-typed GValue to the property which results in
> > an error.
> > 
> 
> You are using gtk+ 2.4 I assume? This is why.
> 
> > Attached is a patch to work around the issue because I suspect a patch
> > to gtk+ wouldn't go in due to interface compatibility constraints.
> > 
> 
> Ironically, the gtk+ change from 2.2 to 2.4 breaks this compatibility.
> 
> Since gtk# binds to 2.2 I doubt this patch will be accepted until the
> change is made to bind to newer gtk+/gnome versions.

This kind of stuff scares the crap out of me for API stability
guarantees.  This is not the first example of a property type having
changed between 2.2 and 2.4.  For some reason, it doesn't seem like the
gtk+ folks consider this to be an API change, since no method signature
changed and int/uint are "compatible" with enums in C in the realm of
string+void_value APIs.  

I'm afraid we are going to have to add a hack to deal with these kinds
of incompatibilities going forward, but I don't have any good ideas on
how to deal with it yet.

-- 
Mike Kestner <mkestner@ximian.com>