可可预定义调整鼠标光标大小? [英] Cocoa predefined resize mouse cursor?
问题描述
预览(例如调整形状大小时)使用的调整大小鼠标光标是否为系统光标?
Is the resize mouse cursor used by Preview (e.g. when resizing shapes) a system cursor?
它不能直接作为 NSCursor
中的方法使用,但看起来预览应用程序包中的光标也没有私有资源..
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..
除了NSCursor
类定义的方法之外,还有更多的系统游标吗?
Are there more system cursors other than the methods defined by the NSCursor
class..?
推荐答案
我想你对这些类方法特别感兴趣(Preview.app dissasembly).
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];
根据 AppKit 的反汇编,这些是 NSCursor 的私有方法.
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];
还有更多
这篇关于可可预定义调整鼠标光标大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!