8

Is the resize mouse cursor used by Preview (e.g. when resizing shapes) a system cursor?

enter image description here

It's not available directly as a method in NSCursor but then it doesn't look like there's a private resource for the cursor in the Preview app's bundle either..

Are there more system cursors other than the methods defined by the NSCursor class..?

ATV
  • 4,116
  • 3
  • 23
  • 42

1 Answers1

12

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

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

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

You can try it in your code e.g.

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

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

There are more undocumented cursors such as

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

and many many more enter image description here

Marek H
  • 5,173
  • 3
  • 31
  • 42
  • 1
    Most of the above cursors are documented; search for them (without the leading underscore) at http://developer.apple.com. Most of them are at . – geowar Mar 31 '16 at 15:12
  • 1
  • You are right, but the question was about rotated resize cursors which I can't find in the documentation. Updated link to documentation. https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSCursor_Class/#//apple_ref/doc/constant_group/AppKit_Versions_for_NSCursor_Bug_Fixes – Marek H Apr 14 '16 at 05:29
  • Any idea where this is hidden in Swift? https://stackoverflow.com/questions/49297201/diagonal-resizing-mouse-pointer – qwerty_so Mar 16 '18 at 08:50