• 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: Menu item enabling when NSView is first responder?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Menu item enabling when NSView is first responder?


  • Subject: Re: Menu item enabling when NSView is first responder?
  • From: Greg Titus <email@hidden>
  • Date: Wed, 7 Nov 2001 12:57:49 -0800

On Wednesday, November 7, 2001, at 12:42 PM, Robert Miller wrote:
Here's probably a basic question that I haven't been able to find an
answer to. How do you enable / disable menu items say, in the Edit menu
when you have an NSView that is the first responder ? I know that an
NSDocument uses validateMenuItem but, cannot find the equivalent for an
NSView / NSResponder ? Any help is greatly appreciated.

Actually, -validateMenuItem: goes through the responder chain, so you can just implement it on your NSView subclass and it'll work just as you'd expect. Also, menu items will automatically disable themselves if there is nothing in the responder chain that responds to their selector so you can feel free to add menu items with selectors that only your view responds to and the items will automatically disable themselves when your view isn't the first responder.

Hope this helps,
-Greg


References: 
 >Menu item enabling when NSView is first responder? (From: Robert Miller <email@hidden>)

  • Prev by Date: Menu item enabling when NSView is first responder?
  • Next by Date: can't Serialize NSColor
  • Previous by thread: Menu item enabling when NSView is first responder?
  • Next by thread: growing an NSView?
  • Index(es):
    • Date
    • Thread