Regarding hiding the menu bar...

We need to globally disable the menu bar. The reason that we need to globally disable the menu bar is that we're security software and when our software is running the user is limited to where they can go. We also launch another piece of software that the user uses, so the presentation options have no effect - or I don't know how to make them take effect. I know about _HIHideMenuBar, but that effects auto hiding of the menu bar - not quite there.

I was thinking of setting the autohide property, and making a masking window over the menu bar, but when the mouse goes into the magic region at the top of the screen the menubar shows and UX isn't quite happy with that (nor the security dudes).

Another thought was to launch the user software via Process() rather than a command like: do shell script "open -Fnb special.me.com..." but I wasn't having much luck with that. The special software is just a normal MacOS app.

Is there a way to globally hide the menu bar and restore it back to normal? Or is this a case of one of my managers talking to an Apple Manager to explain the use case just in case there's some functionality that might not be available to a mere mortal like me?

Best Regards

John

Replies

Unless I miss something in your question, you can hide the complete bar with:

        NSMenu.setMenuBarVisible(false)

Then you should disable all menu items, such as for File:

        fileMenuItem.isEnabled = false

See some more explanations in this old thread

https://developer.apple.com/forums/thread/41851

Claude:

I use presentation options to hide the dock and menu bar (and other options) within my app, but we need to globally hide the menu bar as we start up an app that has a menu bar. (Short version of a long story: previous developers, access to source, lawyers, and time to re-implement it).

I just need stop the menu bar from sliding down when when it's been told to hide while this app is running.

John

Do you mean you want to hide whatever app is launched ?

Claude:

I want the menu bar to be hidden globally during the execution of this special app. Once the app quits everything goes back to the way the user had it before. It's a security thing - the user has to be locked down when this app is running.

Fun stuff!

John

I want the menu bar to be hidden globally during the execution of this special app. 

In that case,

   NSMenu.setMenuBarVisible(false)

should do the job (but you may have to disable actions if you have any shortcuts)

What happens when you add this in appDidFinishLaunching ?

Claude:

If I do a setMenuBarVisible(false), that'll hide it for my app, but when the 'special' Application starts up, there's the menubar. So doing _HIHideMenuBar, is getting half the requirement done, but if the mouse moves into the 'show menu bar' region at the top of the screen the menu bar appears. We're trying to prevent that.

John

I don't understand what are my app, and 'special' Application

Did you develop the special application ?

Or is it a third party ?

Then what is the link between the 2 ?