PDA

View Full Version : Create program/app to autohide Menubar




cleanup
Jul 11, 2006, 05:57 AM
I'm no programmer. I have no idea how to code anything besides the UBB code on this forum.

But I noticed in DVD Player how when you run fullscreen, the Menubar autohides itself until you move your mouse to the top of the screen at which point it elegantly slides in to allow you to use it.

If someone found the code that DVD Player uses to perform this, and somehow made a program that would enable autohiding of the Menubar at all times, the GUI customization community out there would love you, especially me. You could even charge a small fee for it and people would pay.

Anyone interested? I have no idea what I'm talking about but would it be that hard? Couldn't you just take most of the code from DVD Player.app? :o



robbieduncan
Jul 11, 2006, 06:18 AM
It's quite easy to hide the menubar as long as you are the current app. As soon as you select another app though it will bring the menu-bar to the front again.

You might be able to do this via an InputManager though...

whooleytoo
Jul 11, 2006, 09:16 AM
You could have a process which doesn't appear in the Dock, but has a small, transparent window in place of the menubar. As the window is transparent, any clicks here should pass straight through as if the window wasn't there, but you should still be able to add a tracking rect which would let your app receive notifications of when the cursor is at the top of the screen so as to show the menubar.

The only thing I'm not sure of is how to hide the menubar without displaying a fullscreen 'blanking' window - ideally you'd like to do this in a nice scrolling fashion rather than it just popping in and out.

All in all, it shouldn't take more than a day to do this.

savar
Jul 11, 2006, 11:57 AM
You could have a process which doesn't appear in the Dock, but has a small, transparent window in place of the menubar. As the window is transparent, any clicks here should pass straight through as if the window wasn't there, but you should still be able to add a tracking rect which would let your app receive notifications of when the cursor is at the top of the screen so as to show the menubar.

The only thing I'm not sure of is how to hide the menubar without displaying a fullscreen 'blanking' window - ideally you'd like to do this in a nice scrolling fashion rather than it just popping in and out.

All in all, it shouldn't take more than a day to do this.

There's a simple call to hide the menu bar, but as somebody else said I'm pretty sure it only works when you're the front app. Tracking the mouse is pretty easy -- no window required -- just use a Timer and measure mouse coordinates.

Try this, open an app which hides the menubar (like DVD player) and then command-tab to another application. The menubar comes right back, right?

whooleytoo
Jul 11, 2006, 12:05 PM
Tracking the mouse is pretty easy -- no window required -- just use a Timer and measure mouse coordinates.

It might make little difference in this case, but generally I try to avoid polling timers like this- I'd assume it's more efficient for the OS to handle the tracking rects, particularly since there potentially might be more than one process tracking the mouse movements at a time.