Capturing the mouse and working out the mouse position
Capturing the mouse and working out the mouse position
- Subject: Capturing the mouse and working out the mouse position
- From: "Christian Graus" <email@hidden>
- Date: Fri, 28 Nov 2008 13:32:58 +1030
Hi guys. Although I've subscribed to this list for months, this is my first
post. I'm in the process of migrating from Windows development, so my
questions may have a windows centric bent, in terms of my thinking in terms
of how I'd do stuff under that platform.
Basically, I have an NSTableView in which each row contains an icon and some
text. I have it so when I click on an item, a thumbnail animates up of the
image that the item refers to. So far, so good. I need to achieve two
things:
1 - I need to work out if the mouse is over the icon rather than the text,
b/c I only want the popup to occur if it is. This means I need to know the
mouse pos relative to the control. I can't find a way to work that out. I
am using the shouldSelectRow event, which doesn't get passed a mouse pos.
2 - right now, I hide my popup based on a timer, but what I want to do, is
to 'capture' the mouse, so that no matter where the user clicks when the
popup is visible, the program closes the popup window in response.
Any advice on how to find out the mouse position, how to translate it to be
relative to a control and how to capture the mouse, would be recieved with
much appreciation. Thank you
Christian
_______________________________________________
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