Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I replace the "Do you want to save changes...?" sheet?



Mark,

Many thanks for your reply. Actually, your code is just what I had in
mind when I asked the original question. As for my motivation to replace
the "Do you want to save..." alert  I didn't want to give up on using
NSDocument just because my users don't think of their documents as
"documents".

BTW, I've seen this many times:

if (inAlertSheet) [inAlertSheet orderOut:self];

and wondered  when a sheet is created by NSBeginAlertSheet, does
orderOut:ing it also releases it? If not, then how, when and by whom is
it released eventually?

Thanks again,
-- Dan

On Monday, November 19, 2001, at 08:53 PM, Mark Piccirelli wrote:

> Dan --
>
> Replacement of the "Do you want to save the changes..." alert is not
> one of the customizations of NSDocument we've anticipated, so it's no
> fun to do, but I think there is a way to do it that's not likely to
> break when run against future Mac OS X releases.
>
> It sounds like you really should override -[NSDocument
> -canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:].
> Here's some sample code to walk you through it. It's very similar to
> what NSDocument itself does. You have to override the method itself,
> provide another method that will be invoked after the alert sheet has
> been dismissed, and declare a context structure just to remember a
> little bit of stuff while the sheet's being presented. I haven't
> actually compiled this code, so anything that looks like a typo
> probably is.
>
> -- Mark


References: 
 >Re: How do I replace the "Do you want to save changes...?" sheet? (From: Mark Piccirelli <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.