Xcode Mac -> App with dock like behavior - macos

I wish I could have worded the title better.
Let's say your Dock is on the left side of your screen and you HIDE it. When you move your mouse to the left side of the screen, the dock appears. I want my app to do the same thing. If the user puts their mouse on the left side of the screen, app animates in just like the dock. Then they move their mouse out and it hides.
I only ask for solutions that could be used in the Mac App Store.
Thank you.

Related

How to create an arrow pointing to my app's icon on the menu bar?

I have a menu bar only application. On the first time the user runs the app I want to create an animated arrow pointing to my app's icon on the menu bar.
The first idea I had was to create a NSPopover showing the arrow but that is obtrusive per se because I don't think I can make the popover invisible at all. I just want to make an arrow moving up and down pointing to my app's icon on the menubar and that must be App Store compatible.
Is that possible? How?
You can create a borderless transparent window and set its level to screen saver and set it to ignore mouse clicks. Within this window you can draw your arrow, again use a transparent content view. Look up the docs on NSWindow, NSView etc. to construct this.
Alternatively you can change the menu bar icon of your app itself - switch it, highlight it, animate it. This is the typical way a menu bar app attracts attention. Look up NSStatusItem and NSStatusBarButton.
HTH

OSX Fullscreen API and Menu Bar

When using the OSX FullScreen API, is there a way to detect whether the Menu Bar (or the Dock, for that matter) are currently being displayed over top of your application?
For example, a delegate which notifies the application when the Menu Bar animates in, and then sends another notification when the Menu Bar animates out?
NSMenu.menuBarVisible()
there's also NSMenuBarDelegate protocol which has menuWillOpen() and menuWillClose(). but so far I haven't gotten any luck with this one

Hide menubar and dock after fullscreen video in WebView

I have a cocoa application which is a fullscreen webbrowser using WebView.
Initially the menubar and dock are hidden, and cannot be accessed, which is how I want it, but after a fullscreen window such as a video is displayed, the menubar and dock reappear and stay there.
Any idea how to prevent them from reappearing?
I expect that the video player hid the already hidden menubar & dock when it went full screen. Then when it finished, it showed them again.
You'll probably have to hide them again yourself after the video is done..
Ah, got it. SetSystemUIMode is my friend. I was just searching for the wrong thing on google, that's why I didn't see it.

Restore app from dock

I'm new to programming desktop applications for Mac (though a have a small experience with programming for IPhone).
Suppose I create a new Cocoa project in XCode.
This application does nothing just shows its window. I click on the cross in the red circle and my app minimizes to the dock and it has a blue dot on its icon showing that it's running.
Why when I click on its dock icon it doesnt restore? The same thing happens with Java swing application created by Xcode's "new project" wizard.
What should add to an application so that it would restore itself when I click on its icon in the dock?
thanks
Cross in the red circle closes the window, it does not minimize it to the dock. You should use minus sign in the yellow circle to minimize the window to the dock.
You should check dock programming guide at developer.apple.com to see how you can restore the window (it should include something like [window makeKeyAndOrderFront] when user clicks on the dock icon. You should be able to find that information in aforementioned guide.

Mac OpenGL : No sound volume overlay in fullscreen

I have an OpenGL-based app that can run windowed or fullscreen in OS X 10.5. While in windowed mode, pressing the volume keys in the keyboard changes the volume setting (mute/unmute for example) and the OSX-drawn speaker icon overlay is drawn, as it happens with every other application.
However, in full screen mode, pressing the keys does change the volume setting, but no overlay is drawn - I can't figure out why, since I'm not doing anything different.
Any ides?
When you are in fullscreen, your app captures the display and nothing else can draw to the screen as the window server is not asked to do it's compositing.
If you want to have regular compositing in full screen, you must hide the menu bar, window title bar, and make your window full screen.
Google a bit, there are tons of posts on how to do that without capturing the display.
Edit: this might be of interest: http://developer.apple.com/mac/library/technotes/tn2002/tn2062.html

Resources