开发者

Having an NSWindow always stay in background while still accepting mouse events

I need to have an application, with exactly one window, that always stays behind any other possible applicati开发者_开发问答ons, while still accepting mouse events (so you can draw on it)

I subclassed NSWindow to create a window with NSBorderlessWindowMask. I also did override canBecomeKeyWindow to always return NO, but that does not seem to help.

Any ideas on this?


Problem solved.

[self setLevel:CGWindowLevelForKey(kCGDesktopWindowLevelKey+1)] did the trick!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜