Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoa predefined resize mouse cursor?

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

like image 437
ATV Avatar asked Dec 02 '14 05:12

ATV


People also ask

How do I resize a custom cursor?

If you're on Windows 11, look at the Mouse pointer area from the Mouse pointer and touch settings page. There, you'll find a slider called simply Size. In Windows 10, the slider is called “Change pointer size” and is found in the “Change pointer size and color” section from the Mouse pointer page.

How do I change the size of my mouse in Fedora?

If the cursor is too small, you can increase it in "Universal Access" app > Cursor Size. The change of cursor will take effect completely only after you restart Fedora. Without restart, in some places you will see the new cursor, and in others the old one.


1 Answers

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

like image 129
Marek H Avatar answered Sep 21 '22 03:09

Marek H