[Gtk-sharp-list] Bug with marshalling types into a TreeStore column of type object

Chris Seaton chris at chrisseaton.com
Thu Nov 23 12:50:02 EST 2006

I have a TreeStore with a column of type object. When I try to store  
a bool or int, or presumably other basic types, it causes an error.  
If I wrap the same values into a new class, it works fine.

I've included a test program. I get the output

(<unknown>:693): Gtk-WARNING **: gtktreestore.c:822: Unable to  
convert from gboolean to GtkSharpValue
(<unknown>:693): Gtk-WARNING **: gtktreestore.c:822: Unable to  
convert from gint to GtkSharpValue

I'm using on a PowerPC mac.


Chris Seaton


mcs -pkg:gtk-sharp-2.0 test.cs
mono test.exe


using System;

using Gtk;

class GtkProofBox
     public object obj;

class Test
     public static void Main(string[] args)

         TreeStore store = new TreeStore(typeof(object));

         // These cause an error


         // These do not

         GtkProofBox box1 = new GtkProofBox();
         box1.obj = true;

         GtkProofBox box2 = new GtkProofBox();
         box2.obj = 14;

More information about the Gtk-sharp-list mailing list