可可预定义的调整大小的鼠标光标? [英] Cocoa predefined resize mouse cursor?

查看:131
本文介绍了可可预定义的调整大小的鼠标光标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

预览(例如,在调整形状大小时)是否使用了调整大小的鼠标光标作为系统光标?

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毫无用处).

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆