• 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: NSMenuDelegate menuDidClose called before NSMenuItem's action?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMenuDelegate menuDidClose called before NSMenuItem's action?


  • Subject: Re: NSMenuDelegate menuDidClose called before NSMenuItem's action?
  • From: Peter Ammon <email@hidden>
  • Date: Fri, 25 Jun 2010 15:26:14 -0700

On Jun 25, 2010, at 2:58 PM, augusto callejas wrote:

> hi-
>
> i'm constructing an NSMenu with a delegate to handle menuDidClose.
> that menu has an NSMenuItem that had an action to handle when its selected.
> when i select the menu item from the menu, it calls menuDidClose, and then
> the action of the NSMenuItem.  i would expect the other order, but the documentation
> doesn't state what order these messages are sent.  is there a way to specify what
> order these messages are sent?
>
> thanks,
> augusto._______________________________________________

Hi Augusto,

The menu always closes before the action is sent.  Imagine the user choosing File->Open:  if the action were sent before the menu was closed, the File menu would remain open until the Open panel is dismissed.

If you want to be notified after the action is sent, perhaps you want NSMenuDidSendActionNotification.

Hope this helps,
-Peter_______________________________________________

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: NSMenuDelegate menuDidClose called before NSMenuItem's action?
      • From: augusto callejas <email@hidden>
References: 
 >NSMenuDelegate menuDidClose called before NSMenuItem's action? (From: augusto callejas <email@hidden>)

  • Prev by Date: NSMenuDelegate menuDidClose called before NSMenuItem's action?
  • Next by Date: Re: NSMenuDelegate menuDidClose called before NSMenuItem's action?
  • Previous by thread: NSMenuDelegate menuDidClose called before NSMenuItem's action?
  • Next by thread: Re: NSMenuDelegate menuDidClose called before NSMenuItem's action?
  • Index(es):
    • Date
    • Thread