Re: Cocoa Drawers Example
Re: Cocoa Drawers Example
- Subject: Re: Cocoa Drawers Example
- From: Scott Anguish <email@hidden>
- Date: Sun, 17 Jun 2001 02:08:32 -0400
On Saturday, June 16, 2001, at 08:21 PM, jgo wrote:
Then, just drop in a button in the main window, control-drag it to the
NSDrawer icon and connect it to toggle: and you have a basic drawers
implementation setup!
Yep, so far, so good. But let's say you want to have some
settings in the drawer, and click a button to apply them
to objects in the parent window. When you get the word
that the button is clicked, it nicely lets you know that
the button was the sender. But to get back to the parent
window you need to access the drawer that contains the
view(s) that contains the button. Only I don't see a way
to do that. If I try to grope my way up the view hierarchy
from the button, I never get to the drawer itself.
the likely target for the button would be the document subclass I'd
think, and so you'd already know where this is being applied to..
if you're not using the NSDocument stuff, then you'd need to make
sure that the target knew the window that it was related too. or you
could just allow the responder chain to handle things.
if you look at [sender window] it is an NSDrawerWindow which is a
private class, it seems like it could be very useful to be able to send
that class a [parentWindow] message.