• 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: Arun <email@hidden>
  • Date: Wed, 10 Dec 2008 11:19:30 +0530

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.

-Arun KA



On Wed, Dec 10, 2008 at 12:21 AM, Raleigh Ledet <email@hidden> wrote:

> 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 (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
>>
>
>
_______________________________________________

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

  • Follow-Ups:
    • Re: How to launch window of the application on clicking of dock icon?
      • From: Ömer Kardaş <email@hidden>
    • Re: How to launch window of the application on clicking of dock icon?
      • From: Ken Thomases <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>)

  • Prev by Date: Re: How to use NSWorkspace?
  • Next by Date: Re: Fix for Core Data + NSTreeController + NSOutlineView Crashes?
  • 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