Cocoa predefined resize mouse cursor?

1.7k views Asked by At

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..?

1

There are 1 answers

4
Marek H On

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