Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS X - app without menu?

Tags:

macos

cocoa

I'd like to build an app that does not have a menubar, a dock icon, or sits in the app switcher. Basically, it should be like Quicksilver: I'd active it through a global hot key, say from Safari, and a little window appears, but Safari does not get inactive, neither does a different menubar show. I hope you understand what I mean...

How would I do that? I can prevent the dock icon, the app switcher, but I do not know how I can prevent the other apps from becoming inactive when my app's window shows or how I can remove the menu.

Thanks for any hints!

like image 911
ryyst Avatar asked May 22 '11 18:05

ryyst


People also ask

How do I hide app menu on Mac?

One low-key feature on Mac is the ability to auto-hide menu bar. To do this, open System Preferences > General. Check the option to “Automatically hide and show the menu bar” and the menu bar will immediately disappear.

How do I hide the app bar at the bottom of my Mac?

1) Click the Apple icon to open the menu. 2) In the menu, select System Preferences. 3) Select Dock & Menu Bar from the next window. 4) In the window that opens, select the Automatically hide and select the Dock option.

How do you turn on the menu on a Mac?

Using a Keyboard Shortcut to Access the Menu BarUse Ctrl + F2 to focus on the menu bar. You may also need to hold the Function key if your Mac has one. Once you've focussed on the menu bar, use the arrow keys and Space or Return to select an item from the Apple or App menu.

How do I make Mac apps open in full screen?

On your Mac, move the pointer to the green button in the top-left corner of the window, then choose Enter Full Screen from the menu that appears or click the button . In full screen, do any of the following: Show or hide the menu bar: Move the pointer to or away from the top of the screen.


2 Answers

Try searching for "LSUIElement". That should give you all the information you need.

(Specifically, this page in the documentation).

like image 108
Dave DeLong Avatar answered Oct 21 '22 01:10

Dave DeLong


As Dave already said, add

LSUIElement  YES

in your application's Info.plist file. That will get rid of icon and menu bar.

Then, to actually bring a window to the front at the appropriate time (e.g. when triggered through a global keyboard shortcut), you could do something like this:

ProcessSerialNumber psn = {0, kCurrentProcess};
SetFrontProcess(&psn);

[someWindow makeKeyAndOrderFront:nil];
like image 32
puzzle Avatar answered Oct 21 '22 00:10

puzzle