• 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
highlighting menus in the menu bar on Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

highlighting menus in the menu bar on Leopard


  • Subject: highlighting menus in the menu bar on Leopard
  • From: Martin Wierschin <email@hidden>
  • Date: Thu, 1 Nov 2007 21:40:00 -0700

Hi everyone,

Our application supports multi-character keyboard shortcuts. Once we detect that the user has completed such a shortcut we dispatch the action assigned to the NSMenuItem as appropriate. This all still works just fine, except for one detail: the top-level menu that encompasses the activated item no longer highlights itself so the user has some visual feedback on which item was activated.

Despite using NSMenu's "performActionForItemAtIndex:" we always had to do this highlighting manually, using the following code, which fails on Leopard:

	@implementation NSMenu (Additions)

	- (void) highlightInMenuBar
	{
		MenuRef ref = _NSGetCarbonMenu( self );
		MenuID menuID = (NULL == ref) ? 0 : GetMenuID( ref );
		HiliteMenu( menuID );
	}

	@end

I know that "_NSGetCarbonMenu" is an undocumented private API, but actually that's not what fails on 10.5, it's the "GetMenuID" call that always returns zero. Does anyone know any other way to accomplish this highlighting?

Thanks in advance,

~Martin

_______________________________________________

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: highlighting menus in the menu bar on Leopard
      • From: Martin Wierschin <email@hidden>
  • Prev by Date: WebView, NSPrintOperation and Leopard
  • Next by Date: Re: CILinearGradient drawing backwards in 10.5
  • Previous by thread: WebView, NSPrintOperation and Leopard
  • Next by thread: Re: highlighting menus in the menu bar on Leopard
  • Index(es):
    • Date
    • Thread