Re: updating menuitems when not first responder
Re: updating menuitems when not first responder
- Subject: Re: updating menuitems when not first responder
- From: Matt Neuburg <email@hidden>
- Date: Tue, 28 Sep 2004 07:32:19 -0700
On Mon, 27 Sep 2004 17:41:06 -0700, Bertrand Landry-H?tu
<email@hidden> said:
>I'm trying to do a menu the finder does with the view menu and the (as
>List, as Icons, as Column) menu. If you look at the menu it shows a
>check mark for the appropriate view when you have a finder browser
>window up. So I'm doing it alright by implementing the validateMenuItem
>and setting the state to NSOffState and NSOnState to match my view. But
>when another window comes up that does not implement the appropriate
>selectors it a) disable the menu items b) keeps the check marks to the
>state the user last opened the menu. Now, looking at the finder again,
>it does not have that issue (open the find window for example and every
>greys out and check marks are going away).
>
>I have another example of that when I change the title of the menu to
>be context sensitive to match the user's selection.
>
>So basically, what is the recommended way of resetting menu states once
>the focus goes away
(1) There is more than one way to enable a menu item. Automatic enablement
may not suit every situation. Consider manual enablement.
(2) There is a responder chain. If it is not the job of any particular
window to decide whether a menu item should be enabled, place that
decision-making power higher in the responder chain.
(3) Consider use of a menu delegate. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden