Re: -[NSWindow parentWindow] for sheet never works?
Re: -[NSWindow parentWindow] for sheet never works?
- Subject: Re: -[NSWindow parentWindow] for sheet never works?
- From: Quincey Morris <email@hidden>
- Date: Tue, 24 Nov 2015 21:58:02 -0800
- Feedback-id: 167118m:167118agrif8a:167118sjB99_p4RM:SMTPCORP
On Nov 24, 2015, at 14:54 , Graham Cox <email@hidden> wrote:
>
> you close the sheet itself by sending -endSheet to the SHEET, not its parent
I’ve been puzzling over this statement for a while.
At first I thought, “Oh, that’s right, you can. I guess you can send it to the sheet or the sheet’s parent window.” But then I remembered that this method has a parameter that’s the sheet window. So, I’m not sure what ‘[sheet endSheet: sheet]’ would do, if that’s what Graham meant.
There’s also an [application endSheet:] method, but that’s now deprecated.
In the end, I’ve come to the (possibly incorrect) conclusion, and that Graham misspoke. I think you can close the sheet with ‘[sheet orderOut: nil]’ too — at least from the completion block** — and my guess is that’s what Graham was thinking of. In fact, I think you used to be able to close the sheet with [sheet close] too, but I have a vague recollection that it crashes now, or has some other drawback.
** Sometimes the callback has to make sure the current sheet has really gone before putting up a second sheet. Of course, it’s now allowable to nest sheets, which changes the game yet again.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden