Re: disabling click-through in transparent views (seeking comments)
Re: disabling click-through in transparent views (seeking comments)
- Subject: Re: disabling click-through in transparent views (seeking comments)
- From: Josh Anon <email@hidden>
- Date: Thu, 15 May 2003 08:45:39 -0700
I don't really have a comment, but could you elaborate a little on
what you did in sendEvent of the window subclass? I did not understand
the bit about the "child window".
Sure--a child window is a window attached to a parent window that moves
with it and such, similar to a drawer, but the child window can be at a
different level, in this case on top of the parent window (see
NSWindow). It's good for an overlay window.
In this case, I first subclassed the parent window. sendEvent: now
looks like this:
-(void)sendEvent:(NSEvent*)ev {
NSEnumerator *childEnum = [[self childWindows] objectEnumerator];
id w;
//we should only have 1 child
while (w = [childEnum nextObject]) {
[ev setWindow:w];
[w sendEvent:ev];
}
[super sendEvent:ev];
}
To support this, I also hacked a setWindow:/setWindowNumber: method
into a NSEvent category (that's part of the reason I don't like this
hack) to fool the child window into thinking it got this event in the
first place. It works quite nicely in my case, but again, I don't
think it's the ultimate right-way answer.
Hope that helps you!
Josh
--
Josh Anon
Studio Tools Intern, Pixar Animation Studios
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.