Re: No parent window for sheets?
Re: No parent window for sheets?
- Subject: Re: No parent window for sheets?
- From: Jim Correia <email@hidden>
- Date: Sat, 8 Mar 2008 19:20:38 -0500
On Mar 8, 2008, at 4:56 PM, Paul Kim wrote:
I always assumed that sheets had a child-parent relationship with
the window they were attached to. In my little test, calling -
parentWindow on the sheet returns nil. The "parent" window does not
have any child windows but -attachedSheet does return the sheet.
Parent/child windows are a different feature than sheet/sheet-owner.
As for why this matters, I was trying to determine if a window was a
sheet. While -isSheet seems to work, if you read the documentation
you'll see that it's defined rather oddly; it would probably be more
accurately named -wasEverASheet. Thus, I was hoping to instead to
get the parent's attached sheet and compare it to the current
window. In the end not a big deal. My main concern is that -isSheet
seems to leaves the door open for some odd edge cases.
You can get the sheet's owner window by walking the window list. This
is obviously O(N), but that may not be a problem in practice.
Jim
_______________________________________________
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