Beispiel #1
0
 static void OverrideAddWidget(GLib.GType gtype, AddWidgetNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("add_widget"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Beispiel #2
0
        private void InternalAddWidget(Gtk.Widget widget)
        {
            AddWidgetNativeDelegate unmanaged = class_abi.BaseOverride <AddWidgetNativeDelegate>(this.LookupGType(), "add_widget");

            if (unmanaged == null)
            {
                return;
            }

            unmanaged(this.Handle, widget == null ? IntPtr.Zero : widget.Handle);
        }
Beispiel #3
0
        private void InternalAddWidget(Gtk.Widget widget)
        {
            AddWidgetNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("add_widget"));
                unmanaged = (AddWidgetNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AddWidgetNativeDelegate));
            }
            if (unmanaged == null)
            {
                return;
            }

            unmanaged(this.Handle, widget == null ? IntPtr.Zero : widget.Handle);
        }
Beispiel #4
0
		static void OverrideAddWidget (GLib.GType gtype, AddWidgetNativeDelegate callback)
		{
			GtkUIManagerClass class_iface = GetClassStruct (gtype, false);
			class_iface.AddWidget = callback;
			OverrideClassStruct (gtype, class_iface);
		}