How do you programmatically hide the menu bar in a cocoa app? I would like to make full use of the screen area.
How do you hide the menu bar in a Cocoa app?
4.1k Views Asked by uchuugaka At
2
There are 2 best solutions below
Related Questions in OBJECTIVE-C
- How do I customize NSOutlineView to have border color?
- UIWebView Screen Fitting Issue
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Image and Text locations in UIButton
- setting OpenGL version in objective-C
- Setup code for xibs in iOS. -awakFromNb:
- realm db, get parent link of object
- CFBundleDocumentType is not working in myproject-Info.plist file
- UIPopoverPresentationController not rendering properly
- Using Storyboard Reference
- Pass Data between two view controllers using 'Delegation' : Objective-C
- Unexpected CALayer Vertical Flipping on 3D Rotation 'Bounce'
- Setting View orientation to portrait is ignored
- UITextField append / between dates while enforcing character limit
Related Questions in COCOA
- How do I customize NSOutlineView to have border color?
- How to generate request format for WCF web service method for Mac and iPhone
- How to Handle Command Line Prompt from a Cocoa App
- Change views inside NSSplitViewController
- CMYK NSImage get pixel data
- Reactive Cocoa Conditional Split ?
- Set background color of NSImageView with proportionally sized image
- Use NSWindow or NSViewController?
- Imports and includes in header files - when is it okay?
- How to prevent the app from automatically open a window when launched?
- Swift NSViewController responds to mouseDown event, but not keyDown event
- "stringByAddingPercentEncodingWithAllowedCharacters" replaces more characters than it should
- cocoa - what happen when close a window (by pressing the red X button)?
- Does it necessary to go back to main thread to update UI?
- WebView not responding to Keyboard input
Related Questions in MENUBAR
- Dynamic Menu in Qt Application
- jquery menu bar - syntax error
- How to make a menubar app look good with "Dark Mode" in Yosemite?
- Does Apple allow animated elements in menubar apps?
- How to exit a Tkinter window from a menubar
- Improving pure HTML+CSS iframe menu
- How do i get the active ribbon tab name?
- CSS and HTML for menubar
- macOS menubar application: main menu not being displayed
- Prevent error "funk" sound in event monitor OS X
- Adding a Win32 menu bar to pre-existing GUI
- Get list of chrome extensions allowed in Incognito Mode
- Python shows wx window,but menu bar is not displayed. Why?
- tkinter menubar disappears when matplotlib figure opens
- Electron Menubar Icon Size
Related Questions in DOCK
- OSX Yosemite Dock magnification disabled
- OSX multiple process app
- How to create a FullScreen NSWindow which should show the dock but hide menu bar?
- OSX make command line app show icon in dock while running
- how to change dock icon using swift programming language
- How can I display multiple dock items for jFrames within one Java application?
- How to change docked icons on android for a custom rom?
- how to change dock icon using setContentView to display one big character in mac os x
- Why I can't see some controls when I'm using Syncfusion to docking them in C#.NET?
- How To Implement Apparently System-Wide Changes (Status Bar, Dock) in iOS7?
- How to verify if the phone is docked?
- Creating an application that shows up when an Android phone is docked
- bundle a jnlp so you can add to dock on a mac?
- How to launch a Qt application as tray icon without a window
- How to dock in parent container using code
Related Questions in NSMENU
- Cocoa Dynamic List in NSMenu
- Swift: NSStatusItem menu behaviour in 10.10 (e.g. show only on right mouse click)
- NSMenuItem custom view not updating
- NSTableCellView setEditable
- Getting the initiator for an NSMenuItem
- How to gray out an NSMenuItem?
- set titles of items in my app's main menu?
- NSView's context NSMenu is never shown even though all the right methods are being called
- NSMenuDelegate not called for submenu in NSMenuItem created by another NSMenuDelegate
- NSMenuItem with custom view disappears while scrolling
- How to enable auto generation of Window MenuItems (e.g. Tile Window to Left/Right of Screen and Open file with checkmark) in macOS menubar
- Adding menu to your Mac apps in Xcode
- How can i pop up NSMenu at mouse cursor position?
- How to retrieve the current selection of an NSPopUpButtonCell?
- Mac OS X: How to rebuild menu dependences
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There are two good ways I know of to do this.
1 In Cocoa, you can call the NSMenu class method
setMenuBarVisible:to show or hide the menu bar.As of this writing, the documentation for the NSMenu class does not tell you the following additional information.
The menu bar will only be hidden for the app that calls this method. The Dock will also be hidden at the same time.
(This is true at least in 10.9 and I have not tested any other versions.)
This is useful when you want to use an app in a full screen way where you have a cover window, a borderless window the size of the screen. The nice feature of this (as opposed to playing with LSUIElement settings) is that your app can continue to be in the application switcher cycling, as well as visible in the Dock when other apps are active. This allows users to still activate a full screen app through the Dock or application switcher. That means you can still use your app's Dock menu to access a preferences window for your app or other features. This is incredibly convenient if your app is indeed a full screen cover window that runs at a window level higher than other apps, but you still want to make preferences and the ability to quit your app available, and you want your app's visual functionality available when other apps are active.
2 Another option is via
NSApplication's methodsetPresentationOptions:with the arguments fromNSApplicationPresentationOptionsenum, such as optionNSApplicationPresentationHideMenuBarWith this approach be very wary of reading the documentation, although it gives you additional options, and is still app-specific only, you need to know that some of the options are mutually exclusive. There are rules you must follow, or you get nothing but exceptions spewed to the console.3 There is a 3rd and crappy option. If you have a helper app that is a daemon, you can use it to change your app's LSUIElement state and basically relaunch your app. It's dumb and it takes you out of the app switcher completely, which is great if you really are writing something that should not be there, but that is rare.