• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Checking/unchecking a menu item based on responder chain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking/unchecking a menu item based on responder chain


  • Subject: Re: Checking/unchecking a menu item based on responder chain
  • From: Glen Low <email@hidden>
  • Date: Sat, 8 May 2004 18:58:41 +0800

Allan, All:

On 08/05/2004, at 6:04 PM, Allan Odgaard wrote:

On 8. May 2004, at 11:00, Glen Low wrote:

Assuming that according to good MVC/GUI/ [insert alphabet soup] practice, I don't want the object to "know" about the menu item, is there a neat way of getting the menu command to check or uncheck when the object gets to be in the responder chain?

What do you mean by check and uncheck? Are you referring to sending setState: with NSOnState and NSOffState?

Yes.

The item will automatically manage the enabled state based on wether or not there is a target in the responder chain which responds to its action method, and when there is, it will send validateMenuItem: to that target, where the target can respond with NO to disable the item (despite being in the responder chain) and it can also do other things like setting the title of the item or the on/off state (and this method will be sent each time the item is going to be displayed).

I am aware of that protocol, but it is check and uncheck that I want, not enable and disable. Hmm... didn't realize you could check and/or set the title... thanks for that tip.


Cheers, Glen Low


---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Checking/unchecking a menu item based on responder chain (From: Glen Low <email@hidden>)
 >Re: Checking/unchecking a menu item based on responder chain (From: Allan Odgaard <email@hidden>)

  • Prev by Date: Re: Archiving ABPerson
  • Next by Date: Re: [semi-OT] Apple's Help Viewer: a note to the frustrated
  • Previous by thread: Re: Checking/unchecking a menu item based on responder chain
  • Next by thread: [semi-OT] Apple's Help Viewer: a note to the frustrated
  • Index(es):
    • Date
    • Thread