[Gtk-sharp-list] Problems with DiaCanvas# new items
Todd Berman
tberman@off.net
Tue, 03 Aug 2004 14:23:29 -0400
On Tue, 2004-08-03 at 14:17 -0400, Mario Fuentes wrote:
> <CanvasItem>
> delegate Shape ShapeValueDelegate (IntPtr item, ref CanvasIter iter);
>
> static ShapeValueDelegate ShapeValueCallback;
>
> static Shape ShapeValue_Callback (IntPtr item, ref CanvasIter iter)
> {
> CanvasItem obj = GLib.Object.GetObject (item, false) as CanvasItem;
>
> return obj.ShapeValueFunc (ref iter);
> }
>
> [DllImport("diacanvassharpglue")]
> static extern void diasharp_canvas_item_override_shape_value (GLib.GType
> gtype, ShapeValueDelegate callback);
>
> static void OverrideShapeValue (GLib.GType gtype)
> {
> if (ShapeValueCallback == null)
> ShapeValueCallback += new ShapeValueDelegate (ShapeValue_Callback);
>
> diasharp_canvas_item_override_shape_value (gtype, ShapeValueCallback);
> }
>
My guess is it has to do with returning a Shape object. It seems like
you most likely want to return a IntPtr, and return the .Handle off the
Shape.
--Todd