Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
		static void OverrideSetLabel (GLib.GType gtype, SetLabelNativeDelegate callback)
		{
			gtksharp_menuitem_override_set_label (gtype.GetClassPtr (), callback);
		}
Ejemplo n.º 5
0
		static extern void gtksharp_menuitem_override_set_label (IntPtr class_struct, SetLabelNativeDelegate cb);