Making an invisible Cocoa window catch mouse clicks
Making an invisible Cocoa window catch mouse clicks
- Subject: Making an invisible Cocoa window catch mouse clicks
- From: Nicholas Francis <email@hidden>
- Date: Wed, 19 Nov 2008 02:53:13 +0100
Hi guys. I'm working on the Unity game tool.
I'm trying to make my own eye dropper (user clicks eye dropper icon,
clicks somewhere on screen to sample the color) but are running into
an issue catching the second mouse click.
I'm creating a borderless NSWindow (that I move around under the
mouse) and call setAlphaValue: 0 on it to make it transparent. Sadly
this makes the window ignore mouse events, so the click activates
whatever app is under the cursor.
I also tried setOpaque:NO and a clear color, but that had the same
effect.
What is the recommended way of doing what I'm trying to do. Ideally, I
would like to avoid making my own custom event loop - Unity is pretty
picky when it comes to event handling, and doing this would be a large
change. The code is compiled against the 10.4 SDK and has to run on
that platform.
I've tried searching the net, the docs, sample code (roundtransparent
window has the same behavior as I'm seeing), but to no avail. Does
anyone have a hint?
Thanks,
Nicholas Francis
_______________________________________________
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