On May 17, 2011, at 8:08 AM, Pascal J. Bourguignon wrote:
> JAMES ROGERS <jimrogers_w4...@me.com> writes:
> 
>> I am a cocoa developer, albeit a new one.  So I have every right to
>> post this question on this site.

I think Joanna can be forgiven for an honest misunderstanding.

>> Thank you very much, but clicking on
>> the application in the dock does not work in my case.

Yes it does. It brings your app back to the foreground, which is the literal 
question you asked.

>> That would be a
>> rather obvious answer and one of the many things I tried. Based on
>> some of the web guru sites, I am not the first to pose this question
>> and a not willing to accept the answer I see most, "that is the way
>> Mac works".

I agree, that is not the right answer.

[...]
> Now, it's up to the application to leave a mean to resume working when
> all the windows are closed.  The way it's done depends on the
> application, but the only thing that will remain after all the windows
> are closed or hidden, for the user to command the application, is the
> menus.
> 
> So you should have an item in a menu that will order an action, such as
> the opening of a new window.  It is often with the menu File, item
> Open... that the user will be able to open a new document window to
> resume working with the application.

In a document-based application the default is to create a new untitled window. 
You can tell it not to by implementing 
applicationShouldHandleReopen:hasVisibleWindows: in the app delegate. But it 
sounds like your app is not document-based.

> But some applications are not document centered.  You may  propose a
> menu Game / item "New Game", or a menu Activity / item "New Processing"
> or whatever.

Yup. Or if there is a specific singleton window, and it lives in MainMenu.nib, 
you can simply connect the menu item to it in IB with an action of 
makeKeyAndOrderFront:. In this case make sure to uncheck the "Release When 
Closed" checkbox, so the window instance doesn't get prematurely deallocated.

Also you can implement the applicationShouldHandleReopen:hasVisibleWindows: 
method mentioned above to automatically reopen the window, if you prefer.

--Andy

_______________________________________________

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 arch...@mail-archive.com

Reply via email to