static void OverrideAddWidget(GLib.GType gtype, AddWidgetNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("add_widget")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private void InternalAddWidget(Gtk.Widget widget) { AddWidgetNativeDelegate unmanaged = class_abi.BaseOverride <AddWidgetNativeDelegate>(this.LookupGType(), "add_widget"); if (unmanaged == null) { return; } unmanaged(this.Handle, widget == null ? IntPtr.Zero : widget.Handle); }
private void InternalAddWidget(Gtk.Widget widget) { AddWidgetNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("add_widget")); unmanaged = (AddWidgetNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AddWidgetNativeDelegate)); } if (unmanaged == null) { return; } unmanaged(this.Handle, widget == null ? IntPtr.Zero : widget.Handle); }
static void OverrideAddWidget (GLib.GType gtype, AddWidgetNativeDelegate callback) { GtkUIManagerClass class_iface = GetClassStruct (gtype, false); class_iface.AddWidget = callback; OverrideClassStruct (gtype, class_iface); }