[Gtk-sharp-list] Getting a column from a CellRender

Mike Kestner mkestner@speakeasy.net
Fri, 24 Oct 2003 11:39:43 -0500


On Fri, 2003-10-24 at 10:45, Daniel Kornhauser wrote:

> In C :
> This is how you would get the column in the callback
> 	column = g_object_get_data (G_OBJECT (cell), "column");

>      GLib.Object Ugly = (GLib.Object) rendererToggle;
>      Ugly.SetProperty ("column", new GLib.Value ((int) Column.Alex));

That won't work, because there is no "column" property of a
CellRenderer.  It will just give you g-warnings at runtime.

The Gtk# way to set arbitrary data on an object is to use the
GLib.Object.Data hash.  For example:

ugly.Data ["column"] = Column.Alex;

-- 
Mike Kestner <mkestner@speakeasy.net>