Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Matching Cocoa Window Levels in Carbon



I'm trying to integrate some Cocoa windows into my Carbon application. I find that there is some kind of window level mismatch between floating windows in the two environments. For example by default, floating Cocoa windows appear above modal Carbon windows. I've been playing with the window level features of window groups but all window levels appear to be zero. For example, if I call DebugPrintAllWindowGroups() I get the following:

Window group tree
------------------------------------------------------------------------ -------
1 level 0 group 0x7610C03F "com.apple.hitoolbox.windowgroups.root"
2 level 0 group 0x7610C60F "com.apple.HIToolbox.windowgroups.floating"
3 level 0 group 0x72C345BF "com.apple.HIToolbox.windowgroups.document"

If I set the window group level of kFloatingWindowClass to kCGBackstopMenuLevelKey my floating windows appear to be at the same level as default floating Cocoa windows (it seems that neither Carbon or Cocoa is using kCGFloatingWindowLevelKey for floating windows, but I guess that's not important).


I could set the window levels of the standard window groups during initialization and set the level of Cocoa windows as I create them. For example:

SetWindowGroupLevel(GetWindowGroupOfClass(kDocumentWindowClass), kCGNormalWindowLevel); SetWindowGroupLevel(GetWindowGroupOfClass(kFloatingWindowClass), kCGFloatingWindowLevel); SetWindowGroupLevel(GetWindowGroupOfClass(kModalWindowClass), kCGModalPanelWindowLevelKey);

and

[myWindow setLevel:NSNormalWindowLevel];
[myWindow setLevel:NSFloatingWindowLevel];

Is this a reasonable thing to do or will this bite me somewhere down the road?

Thanks,
Nick Nallick
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.