static void OverrideSetLabel(GLib.GType gtype, SetLabelNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("set_label")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private void InternalSetLabel(string label) { SetLabelNativeDelegate unmanaged = class_abi.BaseOverride <SetLabelNativeDelegate>(this.LookupGType(), "set_label"); if (unmanaged == null) { return; } IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup(label); unmanaged(this.Handle, native_label); GLib.Marshaller.Free(native_label); }
private void InternalSetLabel(string label) { SetLabelNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("set_label")); unmanaged = (SetLabelNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SetLabelNativeDelegate)); } if (unmanaged == null) { return; } IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup(label); unmanaged(this.Handle, native_label); GLib.Marshaller.Free(native_label); }
static void OverrideSetLabel (GLib.GType gtype, SetLabelNativeDelegate callback) { gtksharp_menuitem_override_set_label (gtype.GetClassPtr (), callback); }
static extern void gtksharp_menuitem_override_set_label (IntPtr class_struct, SetLabelNativeDelegate cb);