• 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 Bindings Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Menu Item Bindings Problem


  • Subject: Re: Menu Item Bindings Problem
  • From: Chris Outwin <email@hidden>
  • Date: Sun, 26 Feb 2006 21:45:46 -0600

Thank you for your help, Matt.  I have it working now.

Chris

On Feb 26, 2006, at 5:56 PM, Matt Neuburg wrote:

On Sat, 25 Feb 2006 20:57:26 -0600, Chris Outwin <email@hidden> said:
I am having trouble changing a menu item from IBAction to Bindings.
The purpose of the menu item is to show/hide a NSPanel. The menu
item should change its title accordingly. My bindings code correctly
displays the initial menu item title, but the menu item is grayed- out.


Apple's Enabling Menu Items docs says, "NSMenu searches the
appropriate objects to find one that responds to the menu item‚s
action method. If it can‚t find such an object, it disables the menu
item."  My object doesn't have an IBAction method, since I'm using
bindings.

An NSMenuItem doesn't have target/argument bindings, so you're still going
to have to give it a target and an action. You can then enable the menu item
by binding its Enabled to something in that target, if you don't want to use
validateMenuItem. m.


--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>


_______________________________________________
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


References: 
 >Re: Menu Item Bindings Problem (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Error with proxy objects and to-many relationships with Core Data
  • Next by Date: Re: Error with proxy objects and to-many relationships with Core Data
  • Previous by thread: Re: Menu Item Bindings Problem
  • Next by thread: kqueue OK in 10.4, not calling back to CFSocket in 10.3
  • Index(es):
    • Date
    • Thread