2
votes

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

1
Are you clicking the Application's icon or the icon on the right hand part of the dock that represents the minimized window?Tom Duckering
the application icon not the icon on the righ handCITBL

1 Answers

2
votes

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.