| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| I have a Cocoa app. I asked this question on the cocoa-dev list and did not get any bites. Further research and thought on this subject has led me to believe that carbon-dev might actually be the correct place to ask this question because I think that the system menu bar is drawn by the Carbon side of the world for all apps. I have an application that is really two applications. A normal one with a menu bar and a dock icon and one which has the LSUIElement Info.plist key turned on (i.e. "faceless", i.e. no menu bar and no dock icon). This faceless app can display a window. When this faceless app shows a window I want it to appear to the user that the window belongs to the normal, menu-bar-equipped app. The problem is that when the frontmost window does not actually belong to the application in possession of the menu bar then the system (which, I'm told, for the menu bar, is Carbon) displays all menu items as disabled (and treats them as such for command key matching/execution too). I have messed with every menu-related hook I could find in the Cocoa side of the world, to force a menu item to appear enabled given the described situation. It appears that only the "model" portion of a menu is accessible from Cocoa (the model classes NSMenu and NSMenuItem used to be associated with the display classes NSMenuView and NSMenuItemCell, but these display classes have been deprecated). I'm thinking the Carbon menu system is ignoring the fact that the menu item's model says to "enable me" and is disabling the item because of the higher precedence it assigns to the fact that the frontmost window does not belong to the application in possession of the menu bar. Is it possible to customize the behavior of the menus in my Cocoa application through Carbon APIs (perhaps, Carbon Events?) so that I can control the enabled state of menu items in the menu bar when the frontmost window does not belong to the application in possession of the menu bar? Or is the system immutable in its behavior for this situation? (As was Obi-Wan for Princess Leia) Eric Schlegel, you're my only hope. Mark Sanvitale Exbiblio |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden This email sent to email@hidden
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.