Mailing Lists: Apple Mailing Lists

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

Re: Correct way to handle kEventCommandUpdateStatus?



On Aug 29, 2003, at 12:29 PM, Jim Correia wrote:

For code I control I can just say register all of my commands in a table. But what happens if I load a plug-in which inserts a menu into my menubar with custom commands in it available only to the plug-in window?? (This isn't a real situation - I'm making it up so I can understand the conceptual model that we are supposed to be using with kEventCommandUpdateStatus.) My application doesn't know about the commands it put in there. Should it be the plug-in's responsibility to also install an application level handler to make sure its commands get disabled?

Yes, it's the plugin's responsibility in that case to ensure that its commands are properly enabled or disabled. You don't have to know about those commands.

If that conceptually makes sense, should each "object" that introduces custom commands into the application also install its own application level handler to make sure its commands get disabled when appropriate, removing the need for the application object to know about custom window commands? This is probably not as efficient as the set lookup, but might provide better encapsulation?

If your application is sufficiently modular to support that approach, then certainly that sounds like a good way to go to me.

-eric
_______________________________________________
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.

References: 
 >Re: Correct way to handle kEventCommandUpdateStatus? (From: Jim Correia <email@hidden>)



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.