• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: No parent window for sheets?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: No parent window for sheets?


  • Subject: Re: No parent window for sheets?
  • From: Mike Abdullah <email@hidden>
  • Date: Sun, 9 Mar 2008 18:35:36 +0000

I guess the assumption on the AppKit's part is that a particular panel/ window will not be recycled as both a sheet and a panel within an application. This kinda makes sense as there can only be a single modal panel up at a time, but there can be multiple sheets. Therefore the method is not so much "Is the window currently being used as a sheet?," but more "Is this window intended for use as a sheet."

On 9 Mar 2008, at 18:12, Paul Kim wrote:

Hi Jim,

Maybe I should just send my queries directly to you in the future since you always seem to be the one answering :)

I think traversing the window list is not worth it for what I am doing (it'll be on my blog soon). While the definition for -isSheet is somewhat odd, I think it should do fine in the context I am using it in.

Thanks,

Paul Kim


On Mar 8, 2008, at 7:20 PM, Jim Correia wrote:

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

_______________________________________________

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


  • Follow-Ups:
    • Re: No parent window for sheets?
      • From: Keary Suska <email@hidden>
References: 
 >No parent window for sheets? (From: Paul Kim <email@hidden>)
 >Re: No parent window for sheets? (From: Jim Correia <email@hidden>)
 >Re: No parent window for sheets? (From: Paul Kim <email@hidden>)

  • Prev by Date: Re: NSUserDefaults and mutability
  • Next by Date: Re: Detecting resolution changes?
  • Previous by thread: Re: No parent window for sheets?
  • Next by thread: Re: No parent window for sheets?
  • Index(es):
    • Date
    • Thread