This depends on your application.

A document based application will automatically create a new untitled document for you. Which is generally what you want. If you app is really document based, its best to use the document based project template.

If you app is not document based (say Mail or System preferences) then you have to consider what the expected / correct behavior is. Mail stays active when you close all of it's windows (checking email in the background). For this behavior use -applicationDidBecomeActive: to check if any widows are shown. If not, then show the expected window.

For some (rare) apps on OS X, staying open is not expected / wanted. For example, System Preferences quits when you close its one and only window. This can be done via - applicationShouldTerminateAfterLastWindowClosed.

If this is just a test app, you might want to try them all to get a feel for it. But for a real app, consider very carefully which behavior you want.

-raleigh

On 09 Dec,2008, at 9:02 AM, Arun wrote:

Hi,

I have created a simple application in cocoa.
when it is ran, the main window appears and a default dock icon in the Dock. If i close the window, the dock icon still stays. But if i click on the dock
icon then also the main window is visible.
The only way i can see the main window is by quitting the app and launching
it again. Is there any way in which upon clicking on the dock,
the application window becomes visible.

Thanks
Arun KA
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/ledet%40apple.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to