Pergunta

I'm wondering if there's a way to get rid of the default NSMenu that you get when you start up a default Mac OS X app, and instead, display the Finders/Systems NSMenu.

(as terrible as it may be, design wise)

Foi útil?

Solução

If an application is flagged in its Info.plist as background-only (LSUIElement), its menu bar will never be displayed on screen, because the application will never be treated as frontmost. This will also cause the application to not be displayed in the Dock, nor in a couple of other standard places (application switcher, Force Quit window, etc). If you decide to go this route, your application should usually provide some sort of alternative UI to show that it's running and to allow the user to quit it (e.g, adding a NSStatusItem to the menu bar).

That being said, there are a few items which your application's menu bar should always contain, whether it's displayed or not, including:

  • Quit, Hide Application / Hide Others / Show All
  • Close Window
  • Undo, Cut / Copy / Paste, Select All

This is because these menu items have common keyboard shortcuts that users will assume are available at all times (e.g, Cmd+X/C/V for Cut/Copy/Paste).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top