static void OverrideShowMenu(GLib.GType gtype, ShowMenuNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("show_menu")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private void InternalShowMenu() { ShowMenuNativeDelegate unmanaged = class_abi.BaseOverride <ShowMenuNativeDelegate>(this.LookupGType(), "show_menu"); if (unmanaged == null) { return; } unmanaged(this.Handle); }
private void InternalShowMenu() { ShowMenuNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("show_menu")); unmanaged = (ShowMenuNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ShowMenuNativeDelegate)); } if (unmanaged == null) { return; } unmanaged(this.Handle); }
static void OverrideShowMenu (GLib.GType gtype, ShowMenuNativeDelegate callback) { GtkMenuToolButtonClass class_iface = GetClassStruct (gtype, false); class_iface.ShowMenu = callback; OverrideClassStruct (gtype, class_iface); }