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

Todd Berman tberman@sevenl.net
Sat, 15 May 2004 20:37:08 -0400


On Sat, 2004-15-05 at 20:05 -0400, Peter Williams wrote:
> On Sat, 2004-05-15 at 18:13, Peter Williams wrote:
> > Hi,
> > 
> > I'm having some kind of problem with setting enum values in HEAD
> > gtk-sharp. When I run the attached program, I get:
> 
> 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.

For now, you can workaround this by using RenderIcon and the "pixbuf"
property instead of the "stock" property.

--Todd

> Peter
>