自定义NSWindow或NSView的本机OSX Lion调整大小光标 [英] Native OSX Lion resize cursor for custom NSWindow or NSView

查看:156
本文介绍了自定义NSWindow或NSView的本机OSX Lion调整大小光标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果对某些指定区域使用NSTrackingArea,则可以实现以下方法来更改默认光标:

If we use NSTrackingArea for some specified region then we can implement such method to change the default cursor:

-(void)cursorUpdate:(NSEvent *)theEvent {
    [[NSCursor resizeLeftCursor] set];
}

我为使用NSBorderlessWindowMaskNSWindow实现自定义大小调整.并希望使用本机Lion的两个箭头光标.但是

I implementing custom resize for NSWindow, which uses NSBorderlessWindowMask. And want to use native Lion's two arrows cursors. But such type of cursors not exist in NSCursor API.

我可以从代码中以某种方式获得此类本机游标吗?
还是我必须手工重画它们(不是一个好主意)?

Can I get such native cursors somehow from code?
Or maybe I must redraw them by hand (not a good idea)?

推荐答案

WebKit在以下目录中包含与系统使用的游标外观完全相同的图像:

WebKit contains images that look exactly the same as the cursors used by the system, in the following directory:

/System/Library/Frameworks/WebKit.framework/Versions/Current/Frameworks/WebCore.framework/Resources/

...例如,文件"northWestSouthEastResizeCursor.png".

...for example, the file "northWestSouthEastResizeCursor.png".

这篇关于自定义NSWindow或NSView的本机OSX Lion调整大小光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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