• 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: Detecting modifier key down when opening a menu?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting modifier key down when opening a menu?


  • Subject: Re: Detecting modifier key down when opening a menu?
  • From: Laurent Daudelin <email@hidden>
  • Date: Tue, 18 May 2010 12:30:36 -0700

On May 18, 2010, at 12:07, Eric Schlegel wrote:

>
> On May 18, 2010, at 12:05 PM, Laurent Daudelin wrote:
>
>> Well, I'd like to track the option key down when a menu is opened so that I can change one of the menu item title dynamically.
>
> I was hoping you'd say that. :) NSMenuItem already has built-in support for this. What you need to do is create two separate menu items and mark them as being alternates of each other (this can be done in IB or with -[NSMenuItem setAlternate:]). One menu item's modifiers should include the option key and the other should not. The menu system will then automatically display the correct menu item depending on whether the user is pressing the option key.
>
> -eric

Wow! I was not aware of that! Is that supported on 10.5 too?

-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 				http://nemesys.dyndns.org
Logiciels Nemesys Software              				email@hidden
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

_______________________________________________

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: Detecting modifier key down when opening a menu?
      • From: Eric Schlegel <email@hidden>
References: 
 >Detecting modifier key down when opening a menu? (From: Laurent Daudelin <email@hidden>)
 >Re: Detecting modifier key down when opening a menu? (From: Nick Zitzmann <email@hidden>)
 >Re: Detecting modifier key down when opening a menu? (From: Laurent Daudelin <email@hidden>)
 >Re: Detecting modifier key down when opening a menu? (From: Eric Schlegel <email@hidden>)
 >Re: Detecting modifier key down when opening a menu? (From: Laurent Daudelin <email@hidden>)
 >Re: Detecting modifier key down when opening a menu? (From: Eric Schlegel <email@hidden>)

  • Prev by Date: Re: Why I can't see my localized nib?
  • Next by Date: NSTask and piped commands
  • Previous by thread: Re: Detecting modifier key down when opening a menu?
  • Next by thread: Re: Detecting modifier key down when opening a menu?
  • Index(es):
    • Date
    • Thread