Re: Getting true parent window of views in drawers
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