开发者

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

开发者 https://www.devze.com 2023-02-23 06:38 出处:网络
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 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

精彩评论

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