static void OverrideTextPopped(GLib.GType gtype, TextPoppedNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("text_popped")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private void InternalTextPopped(uint context_id, string text) { TextPoppedNativeDelegate unmanaged = class_abi.BaseOverride <TextPoppedNativeDelegate>(this.LookupGType(), "text_popped"); if (unmanaged == null) { return; } IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup(text); unmanaged(this.Handle, context_id, native_text); GLib.Marshaller.Free(native_text); }
private void InternalTextPopped(uint context_id, string text) { TextPoppedNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("text_popped")); unmanaged = (TextPoppedNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(TextPoppedNativeDelegate)); } if (unmanaged == null) { return; } IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup(text); unmanaged(this.Handle, context_id, native_text); GLib.Marshaller.Free(native_text); }
static void OverrideTextPopped (GLib.GType gtype, TextPoppedNativeDelegate callback) { GtkStatusbarClass class_iface = GetClassStruct (gtype, false); class_iface.TextPopped = callback; OverrideClassStruct (gtype, class_iface); }