Re: How to launch window of the application on clicking of dock icon?
Re: How to launch window of the application on clicking of dock icon?
- Subject: Re: How to launch window of the application on clicking of dock icon?
- From: Ken Thomases <email@hidden>
- Date: Wed, 10 Dec 2008 03:37:18 -0600
On Dec 9, 2008, at 11:49 PM, Arun wrote:
Thanks for the reply.
My app is not a document based.
I tried using the applicationDidBecomeActive to bring up my main
window. It
works only when my application is not active. i.e., when the
MenuBar is
occupied by other application. If i launch my app and close the
window, the
menu bar is still occupied with My App's menu bar. If noe i click on
the
dock icon, the window will not come up. I need the window to come up.
The advice to use -applicationDidBecomeActive was misguided.
Instead, you should use these delegate methods:
-applicationOpenUntitledFile:
-applicationShouldOpenUntitledFile:
-applicationShouldHandleReopen:hasVisibleWindows:
See here for further explanation: http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_handle_AEs/chapter_11_section_3.html
Note that the methods regarding opening an untitled file do not
necessary have to do with files. They have to do with whatever window
the application should open by default. Also, they are shared by the
code for the original opening of the application, not just reopening,
so be sure to consolidate common code there.
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden