tags:

views:

124

answers:

1

Hello 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

+2  A: 

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.

Eimantas