• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to launch window of the application on clicking of dock icon?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to launch window of the application on clicking of dock icon? (From: Arun <email@hidden>)
 >Re: How to launch window of the application on clicking of dock icon? (From: Raleigh Ledet <email@hidden>)
 >Re: How to launch window of the application on clicking of dock icon? (From: Arun <email@hidden>)

  • Prev by Date: Return Control To Next Active App Without Hiding?
  • Next by Date: Re: How to detect a paste request for file copy/paste?
  • Previous by thread: Re: How to launch window of the application on clicking of dock icon?
  • Next by thread: Re: How to launch window of the application on clicking of dock icon?
  • Index(es):
    • Date
    • Thread