Re: if an NSWindow is a drawer, how can I find the NSDrawer instance?
Re: if an NSWindow is a drawer, how can I find the NSDrawer instance?
- Subject: Re: if an NSWindow is a drawer, how can I find the NSDrawer instance?
- From: Mike Morton <email@hidden>
- Date: Mon, 23 May 2005 16:31:44 -0400
Andy --
On May 20, 2005, at 3:08 PM, Mike Morton wrote:
I have an NSWindow which is showing the contents of a drawer, and I
want to find the NSDrawer instance for it. How can I do this? (I
don't want to check for undocumented classes like NSDrawerWindow.)
I thought I'd be able to do it by asking for the window's
parentWindow, asking the parent window for drawers, then walking the
drawers to find one with a content view whose window is the window I
started with.
How about if you start the search one level higher -- walk NSApp's
-windows to find the one whose -drawers include one whose display
window (i.e., its -contentView's window) is the window you started
with? It means traversing a larger data structure, but maybe not
prohibitively large?
Works very nicely; thanks!
-- Mike
_______________________________________________
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