• 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: Question about menuHasKeyEquivalent:forEvent:target:action:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about menuHasKeyEquivalent:forEvent:target:action:


  • Subject: Re: Question about menuHasKeyEquivalent:forEvent:target:action:
  • From: Steve Mills <email@hidden>
  • Date: Mon, 07 Oct 2013 16:04:53 -0500

On Oct 7, 2013, at 15:19:31, Ken Thomases <email@hidden> wrote:

> The problem is that you can't be sure that -menuHasKeyEquivalent:… is only called when a matching menu item's action would be performed.  The frameworks might have other reasons for invoking that method.

Ack, that's a good point. Cripes.

> Also, if you answer NO, then presumably NSMenu keeps searching and may find another match (perhaps not even among your menu items; perhaps for a Service or whatever).  Then, both actions would fire.

I mistakenly typed NO in my original message. It should've said:

To work around this, I am simply returning YES from menuHasKeyEquivalent and calling performActionForItemAtIndex: from it. Is that a valid workaround?

--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157




_______________________________________________

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: Question about menuHasKeyEquivalent:forEvent:target:action:
      • From: Ken Thomases <email@hidden>
References: 
 >Question about menuHasKeyEquivalent:forEvent:target:action: (From: Steve Mills <email@hidden>)
 >Re: Question about menuHasKeyEquivalent:forEvent:target:action: (From: Ken Thomases <email@hidden>)
 >Re: Question about menuHasKeyEquivalent:forEvent:target:action: (From: Steve Mills <email@hidden>)
 >Re: Question about menuHasKeyEquivalent:forEvent:target:action: (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Autolayout fixed size centering in VFL
  • Next by Date: Re: Question about menuHasKeyEquivalent:forEvent:target:action:
  • Previous by thread: Re: Question about menuHasKeyEquivalent:forEvent:target:action:
  • Next by thread: Re: Question about menuHasKeyEquivalent:forEvent:target:action:
  • Index(es):
    • Date
    • Thread