• 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: How to deal with a MenuItem with both a binded state property and an action method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to deal with a MenuItem with both a binded state property and an action method


  • Subject: Re: How to deal with a MenuItem with both a binded state property and an action method
  • From: Keary Suska <email@hidden>
  • Date: Sat, 28 Jun 2008 10:44:23 -0600
  • Thread-topic: How to deal with a MenuItem with both a binded state property and an action method

6/28/08 8:54 AM, also sprach email@hidden:

> To sumarize, the problem is that I am not able to change the menuItem
> state programatically (ie. in myAction) without avoiding the second
> call to setMenuState. However if the call to myAction comes from a
> button set up in IB (instead the menuItem), then everything goes ok.
> In that case myAction is called by the click of the button and if the
> state of the menuItem is updated by myAction then it is correctly
> changed. No second call to setMenuState is received because the
> originating event came from the button. On the contrary if the event
> originates from the menuItem, first myAction is called, and then
> setMenuState is called.

With controls, the bound value is changed *before* the target-action is
called, as you are seeing, but it seems NSMenuItem does the opposite. If the
calls are sequential--i.e. without a call to the run loop--you could use
performSelector:withObject:afterDelay:to make the setMenuState call.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

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

  • Follow-Ups:
    • Re: How to deal with a MenuItem with both a binded state property and an action method
      • From: "Joan Lluch (casa)" <email@hidden>
References: 
 >Re: How to deal with a MenuItem with both a binded state property and an action method (From: "Joan Lluch (casa)" <email@hidden>)

  • Prev by Date: Re: trackmouse problems in Leopard
  • Next by Date: Using isMemberOfClass with a tree of subclass of NSManagedObject
  • Previous by thread: Re: How to deal with a MenuItem with both a binded state property and an action method
  • Next by thread: Re: How to deal with a MenuItem with both a binded state property and an action method
  • Index(es):
    • Date
    • Thread