• 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: Getting true parent window of views in drawers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting true parent window of views in drawers


  • Subject: Re: Getting true parent window of views in drawers
  • From: glenn andreas <email@hidden>
  • Date: Thu, 9 Mar 2006 16:54:21 -0600


On Mar 9, 2006, at 2:35 PM, Mike Abdullah wrote:

In my app I have an custom NSControl in my app. I want to register it to receive notifications from it's window. However, if the control is inside a drawer, it considers its window to be an instance of NSDrawerWindow.

This class is private, so there is no documentation. If I call parentWindow of it, I get NULL. However, I can call _parentWindow to get the true parent window of the control. Of course this is a private method, so seems a little dodgy to me.

Can anyone suggest either:

A. A better way of doing this?


Get a list of windows, and for each window call drawers to get a list of drawers associated with the window, and then see if your window is one of those drawers' window. May not be the quickest way, but shouldn't be too bad (even if you had a dozen windows with four drawers, that's only 48 things to check). And it's fully documented.



OR

B. How to stop the compiler warning me about calling _parentWindow?

I personally wish that all private methods of classes were listed with a pragma that caused a compiler error to prohibit you from using them at all. It's so easy and tempting to use undocumented methods that far too many people use them as it is...



Glenn Andreas email@hidden <http://www.gandreas.com/> wicked fun! Dominogy | Just place all the dominos on the board...

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Getting true parent window of views in drawers
      • From: Mike Abdullah <email@hidden>
References: 
 >Getting true parent window of views in drawers (From: Mike Abdullah <email@hidden>)

  • Prev by Date: iTMS movie downloads in QTMovieView
  • Next by Date: Re: Getting true parent window of views in drawers
  • Previous by thread: Getting true parent window of views in drawers
  • Next by thread: Re: Getting true parent window of views in drawers
  • Index(es):
    • Date
    • Thread