• 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: glenn andreas <email@hidden>
  • Date: Wed, 10 May 2006 10:42:45 -0500


On May 10, 2006, at 10:18 AM, John Stiles wrote:


Matt Neuburg wrote:
On or about 5/10/06 12:17 AM, thus spake "Nir Soffer" <email@hidden>:


Beeping when the user choose quit is evil


Then perhaps someone should file a bug, because that's how Cocoa behaves
when a sheet is showing at the time the user chooses quit. The worst problem
of all is what happens if the user tries to log out, or chooses Quit from
your app's Dock menu, when a sheet is showing in your app - namely, nothing.
Your app doesn't quit, the logout is blocked, and your app doesn't get an
event so it doesn't even know it's being evil. It took me a very long time
to figure out a way to hack around this (but I did finally solve it, in
NotLight 1.1). m.


My experience has been that the OS shows a dialog for you which says "Logout was canceled because YourApp is busy." or something along those lines.

As for the Dock menu, you're right, it is unintuitive. It's a shame that the OS doesn't query applicationShouldTerminate and automatically dim/hide the Quit item if it comes back with NO.

applicationShouldTerminate isn't used to determine if the quit menu item is disabled or not - it's used only after the quit item is selected, because there are actually three possible results:


NSTerminateNow - go ahead and continue the termination process
NSTerminateCancel - don't quit
NSTerminateLater - we recognized that the user told you that they want to quit, but we can't tell you what to do yet (because we probably need to ask the user something important - perhaps we're in the middle of downloading something for the user) - we'll get back to you when we know.


If it were used for menu validation, then in the "terminate later" case would fire up bogus "are you sure you want to quit while a download is going on" (for example) when you moused over the menu...

Going back to the original problem of "user is in the middle of installing something and selects quit" you could use this to ask the user what they want to do (cancel the installation, or cancel the "quit") - return NSTerminateLater, and present a sheet asking what to do.


Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures, fractals, art



_______________________________________________ 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: 
 >Re: Quit menu item undimming itself?! (From: Matt Neuburg <email@hidden>)
 >Re: Quit menu item undimming itself?! (From: John Stiles <email@hidden>)

  • Prev by Date: NSDocument deprecated routines and compatibility builds
  • Next by Date: Re: NSDocument deprecated routines and compatibility builds
  • Previous by thread: Re: Quit menu item undimming itself?!
  • Next by thread: Core data, tableviews and selection
  • Index(es):
    • Date
    • Thread