• 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: Quit menu item undimming itself?!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Quit menu item undimming itself?! (From: John Stiles <email@hidden>)
 >Re: Quit menu item undimming itself?! (From: Nir Soffer <email@hidden>)
 >Re: Quit menu item undimming itself?! (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Quit menu item undimming itself?!
  • Next by Date: When can useOptimizedDrawing be turned on?
  • Previous by thread: Re: Quit menu item undimming itself?!
  • Next by thread: RE: Quit menu item undimming itself?!
  • Index(es):
    • Date
    • Thread