I want to ask a user to do something when quitting an app, so I throw a display dialog statement in “should quit” handler and make it return true/false based on the returned reply. The dialog has 3 buttons: “Don’t save”, “Cancel” and “Save”. Only when “Save” is hit the app terminates normally. Clicking on the other two buttons gave me this exception:
Modal session cannot be run during application termination
I have also noticed that “Cancel” button has different semantics (obviously it quits an app on the spot). I’d like to ask what is the code pattern for doing this seemingly simple task. Thank you.