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?



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.

Larry

On 8/29/03 3:28 PM, Pietrzak, Bryan didst favor us with:

> Oh.... that's sweet...
>
> But, here's a question Eric. And tell me if it's too skanky...
>
> Couldn't I set that attribute today. And then if my app is running on 10.3
> or later, I my command handlers just ignore menu items with that command,
> letting the OS do the work. But, if on 10.2 or earlier, check that attribute
> and disable the command.
>
> I'd guess that's basically what the standard handler is doing anyway?
>
> Which of course is so obvious now...I could do the same thing today with a
> menu item property. It's a bit inconvenient compared to an attribute I can
> set in my .r file, but it is one approach.
>
> Bryan
>
>> ----------
>> From: Eric Schlegel
>> Sent: Friday, August 29, 2003 2:06 PM
>> To: Jim Correia
>> Cc: email@hidden
>> Subject: Re: Correct way to handle kEventCommandUpdateStatus?
>>
>> On Aug 29, 2003, at 11:17 AM, Jim Correia wrote:
>>
>> In Panther, we've also got a new menu item attribute,
>> kMenuItemAttrAutoDisable, which indicates that a menu item should be
>> automatically disabled if all kEventCommandUpdateStatus handlers return
>> eventNotHandledErr. You could set that attribute on your menu items and
>> then you wouldn't need an application handler just to disable items.

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.



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.