Cocoa predefined sized mouse cursor?

Is the mouse cursor with Preview resizing (for example, when resizing shapes) the system cursor?

enter image description here

It is not directly available as a method in NSCursor

, but then it doesn't look like there is a private resource for the cursor in the Preview app bundle.

Are there any other system cursors besides the methods defined by the NSCursor

.. class ?

+3


source to share


1 answer


I think you are especially interested in these class methods (Preview.app dissasembly).

+[NSCursor resizeAngle45Cursor]; which calls +[NSCursor _windowResizeNorthEastSouthWestCursor];
+[NSCursor resizeAngle135Cursor]; which calls +[NSCursor _windowResizeNorthWestSouthEastCursor];

      

According to AppKit disassembly, these are private methods of NSCursor.

You can try it in your code for example.



 (void)mouseDown:(NSEvent *)theEvent
{
  [[self window] disableCursorRects];

  id cursor = [[NSCursor class] performSelector:@selector(_windowResizeNorthEastSouthWestCursor)];
  [cursor push];
}

      

There are more undocumented cursors like

+[NSCursor _helpCursor];
+[NSCursor _zoomInCursor];
+[NSCursor _zoomOutCursor];

      

and many others enter image description here

+9


source







All Articles