Re: Clicking through a NSView with CALayers
Re: Clicking through a NSView with CALayers
- Subject: Re: Clicking through a NSView with CALayers
- From: Rowan Nairn <email@hidden>
- Date: Sun, 26 Apr 2009 11:09:18 -0700
On Sun, Apr 26, 2009 at 3:08 AM, Bill Cheeseman <email@hidden> wrote:
> Making the window invisible isn't relevant -- visual transparency and
> clickthrough are two different qualities. To make a window transparent to
> mouse events, you have to call -[NSWindow setIgnoresMouseEvents:YES]. Note
> that the entire window will be clickthrough, not just transparent areas.
> Clickthrough works even on windows that are not invisible. It's normally
> used to make overlay windows.
Ok. I think a little detail of my requirements got lost in this
thread somewhere. I'm sorry I'm not able to ask this question clearly
enough. Thanks for keeping at this. So the little detail is this: I
don't want to make my whole window transparent to mouse events. There
are bits of my window on which I want to detect clicks. Those are the
bits that I've drawn on. I want the bits I haven't drawn on, the
visually transparent bits, to ignore clicks.
When I use [NSView drawRect:] this works as expected - any pixel that
is visually transparent is also transparent to clicks. However when I
use a layer (either hosted or backed) the whole area intercepts
clicks, whether visually transparent or not. I'm starting to think
there's no way around this so I might just go back to [NSView
drawRect:] even though it makes the animation slower.
Hope that was somewhat clearer. Thanks for the help,
Rowan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden