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!
精彩评论