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: Sat, 25 Apr 2009 10:15:40 -0700
Hi Volker,
I wasn't clear enough in my original question I think. Yes, my view
is set up to handle clicks and is doing so just fine. It's the
windows of *other* apps underneath my transparent view that I'm
worried about.
Here's how to reproduce my problem. Create a fullscreen transparent
window with an empty view and position it over some other app. You'll
see that when you click on the transparent area the view ignores the
click and lets the app behind be activated. This is the behavior I
want. Now change it to call:
[view setWantsLayer:YES]
Now if you click on the transparent region, you get click events in
the view and the background app never gets activated.
Make sense?
Rowan
On Sat, Apr 25, 2009 at 8:22 AM, Volker in Lists <email@hidden> wrote:
> Hi Rowan,
>
> are you aware that layers don't handle clicks? Does the view containing your
> layers is set to handle mouse events? If not, the behaviour you describe
> sounds expected.
>
> Volker
>
> Am 24.04.2009 um 19:33 schrieb Rowan Nairn:
>
>> Hi,
>>
>> I have a transparent overlay NSWindow the size if the screen and it
>> contains a mostly transparent NSView. I'd like to accept clicks which
>> occur on non-transparent regions of the view but let clicks that occur
>> over transparent regions activate the app underneath. If I draw the
>> view using drawRect: then this works well.
>>
>> However I'd also like to use Core Animation in my view. If I
>> setWantsLayer:YES and draw using CALayers then clicks over transparent
>> regions no longer get passed to apps underneath my window.
>>
>> Is it possible to have my cake and eat it too?
>>
>> 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
>
>
_______________________________________________
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