Re: Binding NSMenuItem state in Document-based app
Re: Binding NSMenuItem state in Document-based app
- Subject: Re: Binding NSMenuItem state in Document-based app
- From: Jerry Krinock <email@hidden>
- Date: Mon, 9 Jun 2008 15:04:27 -0700
On 2008 Jun, 09, at 12:57, Quincey Morris wrote:
Doing this through bindings involves re-inventing a bit of stuff
that NSResponder normally takes care of, but it need not be too
difficult. For example, you could....
Or something like that.
Well, last year sometime I wanted to bind some menu items to values in
the current document, as I believe you're trying to do. You can read
of my saga in the list archives.
After you've considered Quincy's response, recall that bindings is an
alternative which is supposed to make things simpler and reduce
labor. I concluded that the bindings alternative does not fulfill its
purpose when it involves menu items. Target/Action still works. For
menu input, I target an action in FirstResponder, which will be the
current active document. For setting menu status (the checkmark), I
set a tag on the menu item and implement -menuNeedsUpdate. It's old-
fashioned, but I found it to be simpler, cleaner and it works.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden