Cocoa HUD window - how to turn off topmost?
I've wrote some small cocoa app and it's main window has HUD style. The problem is - when I set HUD style Interface Builder automatically also sets Utility style - which make the main window topmost (always visible over every other windows). Is there a way to get HUD style panel/windo开发者_Python百科w but without making it topmost?
As it turns out - there's a pretty simple solution for my topmost problem:
[hudPanel setLevel: NSNormalWindowLevel];
Makes it act like a normal window that isn't topmost.
If you can't do it in IB, you'll have to do it programmatically. In this case, that means creating the window programmatically. (You'll want to move the window's views into a separate top-level view in the nib, and set that view as the programmatically-created window's content view.)
You should also file a bug report, as it doesn't seem from the NSPanel documentation that the HUD style necessarily implies the utility-window nature.
精彩评论