• 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 use NSMenuItem setAlternate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use NSMenuItem setAlternate?


  • Subject: Re: How to use NSMenuItem setAlternate?
  • From: Bill Cheeseman <email@hidden>
  • Date: Tue, 05 Jul 2005 20:50:45 -0400

on 2005-07-05 7:02 PM, Steve Palmer at email@hidden wrote:

> The Cocoa documentation doesn't really explain how to use this
> feature. As a test, I created two menu items in IB and made the
> second an alternate of the first. Same equivalent key but different
> modified. However how does Cocoa decide which one to display?

By checking whether the modifier key is down. You can set this up in
Interface Builder. Typically, the non-alternate would be something like
Command-S for "Save" and the alternate would be Option-Command-S for "Save
All". To test, run the app, use the mouse to open the menu, and push the
Option key down repeatedly. The menu item should switch repeatedly between
the non-modified and the modified menu item text.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes


 _______________________________________________
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: 
 >How to use NSMenuItem setAlternate? (From: Steve Palmer <email@hidden>)

  • Prev by Date: Re: Javabeans in Cocoa/ObjC?
  • Next by Date: Re: Reading & writing Exif data with Cocoa
  • Previous by thread: How to use NSMenuItem setAlternate?
  • Next by thread: How to create background window that can't get focus
  • Index(es):
    • Date
    • Thread