Re: User Experience, Bring App Window back when Clicking Dock Icon
Re: User Experience, Bring App Window back when Clicking Dock Icon
- Subject: Re: User Experience, Bring App Window back when Clicking Dock Icon
- From: Ken Thomases <email@hidden>
- Date: Thu, 1 Apr 2010 08:01:43 -0500
On Apr 1, 2010, at 3:55 AM, Gustavo Pizano wrote:
> I was reading a little about the user Experience, but I hadn't been able to achieve the goal, when I close the window, it closes the it but the app doesn't terminate but I can't bring it back again, I have set in IB to don't release when closed. I tried doing something with the Window Menu, but once I close the window it deactivate all the items, so I can't associate a Menu Item to the App's makeFrontAndKey method, I guess Im really missing something,
>
> The other option I see is that most of the apps once I click the dock icon again it will bring the window back on screen, how to achieve this? some window delegate method?
The application delegate: -applicationOpenUntitledFile:
What's happening is that clicking the Dock icon is "relaunching" the app. The same happens if the user double-clicks the app's icon in the Finder when it's already running. That is handled by:
-applicationShouldHandleReopen:hasVisibleWindows:
-applicationShouldOpenUntitledFile:
-applicationOpenUntitledFile:
If the first two are unimplemented or return YES, then it invokes the third (if it's implemented). In there, you can make your main window key and order it front.
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