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 8/29/03 6:20 PM, Eric Schlegel didst favor us with:

>
> On Aug 29, 2003, at 2:54 PM, Laurence Harris wrote:
>
>> One option is install a kEventMenuEnableItems handler on the application. In
>> it you can disable an entire menu and enable selected commands and then
>> return eventNotHandledErr. After that the commands in the menu will get
>> passed to the chain of kEventCommandUpdateStatus handlers, and if none of
>> them enable a command, it will stay disabled. This may not be appropriate for
>> every menu, but it works well for some.
>
> That's an excellent suggestion for menus that are entirely managed by
> your application (which, in practice, is just about every menu that
> your app provides).
>
> -eric
>
Thanks. It's kind of obvious, but since the obvious sometimes escapes us,
I'll go ahead mention that if you have a menu containing items which are
only handled by the application you can update all of them at once in your
application's kEventMenuEnableItems handler and return noErr. This prevents
a lot of pointless calls to kEventCommandUpdateStatus handlers at various
levels, which is a performance plus.

Larry
_______________________________________________
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: Eric Schlegel <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.