Re: Quit menu item undimming itself?!
Re: Quit menu item undimming itself?!
- Subject: Re: Quit menu item undimming itself?!
- From: Brian Bergstrand <email@hidden>
- Date: Tue, 9 May 2006 15:43:01 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On May 9, 2006, at 3:28 PM, John Stiles wrote:
On May 9, 2006, at 12:13 PM, Nir Soffer wrote:
On 09/05/2006, at 21:56, John Stiles wrote:
I have a Cocoa app which, soon after
applicationDidFinishLaunching is called, creates a window and
dims the Quit menu item via
[evil code trying to disable the quit menu]
But if I check the menu, it's not dimmed.
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.
Questioning my design isn't really an appropriate response here.
Please try to be helpful.
John,
To dim a menu (w/o using bindings) you have to respond to [NSObject
validateMenuItem:]. You may also want to look at [NSApp
applicationShouldTerminate:] and [NSApp
replyToApplicationShouldTerminate:]. Those will allow you to prevent
a high level quit request.
HTH.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQFEYP7aedHYW7bHtqIRAolXAKCesbak66WtD8QvbQ3yOtloIm5RYQCeKuCJ
DGxRPbcR8ygX/DD4rnp0ZP4=
=szYM
-----END PGP SIGNATURE-----
_______________________________________________
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