Reputation: 118
i am working on a cocoa application that creates both normal cocoa windows and cocoa windows that are initialized with carbon windows. All windows should be floating above all applications. For the cocoa windows i set the window level to NSTornOffMenuWindowLevel, and for the carbon windows i use kUtilityWindowClass. Both works fine, windows are floating above other applications, but the problem is that carbon and cocoa windows don't have the same window level, so carbon windows will always float on top of cocoa windows. Is there a way of giving both window types the same window level without losing the floating above other apps? I guess since kUtilityWindowClass seems to be the only window class which enables floating about other apps in carbon, i am looking for its equivalent in cocoa... Thanks for any help!
Upvotes: 1
Views: 692
Reputation: 22717
If you look in NSWindow.h, you'll see that Cocoa window levels are defined in terms of Core Graphics window levels, e.g., NSFloatingWindowLevel
is defined as kCGFloatingWindowLevel
. If you look at where these window levels are defined in CGWindowLevel.h, one of the choices is kCGUtilityWindowLevel
. That would be my guess as the equivalent of kUtilityWindowClass
.
Upvotes: 1
Reputation: 5569
I don't know exactly, but you could experiment. I would try NSModalPanelWindowLevel
(one above NSTornOffMenuWindowLevel
), NSMainMenuWindowLevel
, NSStatusWindowLevel
, and NSPopUpMenuWindowLevel
, which are the other available levels from relatively lower to highest.
Upvotes: 0