• 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: Hiding an NSMenu, or making keyboard shortcuts not tied to a menu item?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hiding an NSMenu, or making keyboard shortcuts not tied to a menu item?


  • Subject: Re: Hiding an NSMenu, or making keyboard shortcuts not tied to a menu item?
  • From: Eric Schlegel <email@hidden>
  • Date: Thu, 17 Jul 2003 09:54:51 -0700

On Wednesday, July 16, 2003, at 6:51 PM, Nick Zitzmann wrote:

In one application I'm trying to make an NSMenu that is hidden from the user, so it doesn't get drawn on the screen, but it does respond to keyboard commands like Command-whatever.

How do I do this? I can't find any way in the reference or in IB to make an NSMenu hidden. I already tried placing a pull-down menu inside a window and hiding it behind a custom view, but it would only show up anyway as a half-transparent menu. I think iTunes does something like this; can this only be done in Carbon?

It's possible to do this with Carbon APIs, in 10.2 and later. Basically you just create an insert a menu into the menubar as usual, but you also set the Hidden attribute on the menu, so the menu doesn't show up in the menubar. (There's a bug in 10.2 that allows the menu to be displayed if you're keyboard-navigating the menubar; that's fixed in Panther).

I don't believe NSMenu currently exports the Hidden menu attribute via a method, so you probably can't do this entirely in Cocoa.

-eric
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Hiding an NSMenu, or making keyboard shortcuts not tied to a menu item?
      • From: Nick Zitzmann <email@hidden>
References: 
 >Hiding an NSMenu, or making keyboard shortcuts not tied to a menu item? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: WebKit headers?
  • Next by Date: Re: now it really gets weird
  • Previous by thread: Hiding an NSMenu, or making keyboard shortcuts not tied to a menu item?
  • Next by thread: Re: Hiding an NSMenu, or making keyboard shortcuts not tied to a menu item?
  • Index(es):
    • Date
    • Thread