On Thu, Jan 29, 2009 at 10:20 AM, Andy Bettis <[email protected]> wrote: > Hi, > > This should be simple enough - I have a non-document application with a > simple one-window interface. I'd like to pop up a 'save changes, discard, > cancel' sheet when Quit is chosen or the window is closed, the same way that > a document based app would. But I can't quite work out where to put it and > how to do it. I guess I should check in windowShouldClose: and > applicationShouldTerminate: but if I have to put up a sheet and wait for the > didEndSelector method to be called how do I carry on with the quit or close?
For -windowShouldClose:, simply return NO. Then when the sheet finishes, close the window or do nothing as appropriate. For -applicationShouldTerminate:, return NSTerminateLater. Then when the sheet finishes, call -replyToApplicationShouldTerminate: with the appropriate value. Mike _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
