Re: Quit menu item undimming itself?!
Re: Quit menu item undimming itself?!
- Subject: Re: Quit menu item undimming itself?!
- From: Sherm Pendley <email@hidden>
- Date: Tue, 9 May 2006 17:06:01 -0400
On May 9, 2006, at 4:28 PM, John Stiles wrote:
On May 9, 2006, at 12:13 PM, Nir Soffer wrote:
Why do you want to disable the quit menu?!
I guess you want to read this: http://developer.apple.com/
documentation/Cocoa/Conceptual/AppArchitecture/Tasks/
GracefulAppTermination.html
Because we're in the middle of an operation, and quitting would
leave files in an incomplete, corrupted state. There is a dialog up
with a cancel button; the user can click Cancel to stop the
operation in a graceful way.
Why not just implement -applicationShouldTerminate: in your NSApp
delegate? It can check for ongoing tasks. If it finds one, it returns
NSTerminateLater and pops up the verification modal dialog. When the
dialog is complete, you call -replyToApplicationShouldTerminate:.
It's the same sequence you'd go through to check for modified
documents before exiting, and ask the user if they should be saved to
disk.
A disabled "quit" menu item leaves no concrete connection between the
fact that its disabled, and that there's a lengthy operation in
progress, and gives the user no indication what can be done to enable
it. The ordinary means of handling this is better - it informs the
user that quitting may not be appropriate at this time, why that's
the case, and what options there are for proceeding.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden