Ejemplo n.º 1
0
 public static void Initialize()
 {
     Default    = MacUtils.GetCursorByName("arrowCursor");
     SizeWE     = MacUtils.GetCursorByName("resizeLeftRightCursor");
     SizeNS     = MacUtils.GetCursorByName("resizeUpDownCursor");
     DragCursor = MacUtils.GetCursorByName("closedHandCursor");
     CopyCursor = MacUtils.GetCursorByName("dragCopyCursor");
     Eyedrop    = Default; // CreateCursorFromResource("EyedropCursor", 7, 24); Disabling for now, cant get hotspot to work.
 }
Ejemplo n.º 2
0
        private static unsafe Gdk.Cursor CreateMacOSNamedCursor(string name)
        {
            var nsCursor  = MacUtils.GetCursorByName(name);
            var gdkCursor = new Gdk.Cursor(Gdk.CursorType.Cross);

            // HACK : Patch the Gdk internal struct with our NSCursor.
            // struct is :
            //   - 4 byte type
            //   - 4 byte ref count
            //   - 8 bytes NSCursor pointer.
            IntPtr *p = (IntPtr *)gdkCursor.Handle.ToPointer();

            p[1] = nsCursor;

            return(gdkCursor);
        }