static void OverrideInserted(GLib.GType gtype, InsertedNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("insert")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private void InternalInserted(Gtk.Widget child, int position) { InsertedNativeDelegate unmanaged = class_abi.BaseOverride <InsertedNativeDelegate>(this.LookupGType(), "insert"); if (unmanaged == null) { return; } unmanaged(this.Handle, child == null ? IntPtr.Zero : child.Handle, position); }
private void InternalInserted(Gtk.Widget child, int position) { InsertedNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("insert")); unmanaged = (InsertedNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(InsertedNativeDelegate)); } if (unmanaged == null) { return; } unmanaged(this.Handle, child == null ? IntPtr.Zero : child.Handle, position); }