Co-ordinate conversion question
Co-ordinate conversion question
- Subject: Co-ordinate conversion question
- From: "Christian Graus" <email@hidden>
- Date: Sat, 29 Nov 2008 16:31:23 +1030
OK, I managed to find the answer to my main question on google ( not for
want of trying previously ).
NSPoint pt = [NSEvent mouseLocation];
NSRect rcTV = [tableView bounds];
pt = [tableView convertPoint:pt fromView:nil];
So, now the first line gives me the mouse position on the screen. The
second gives me the bounds of my control, because the co-ordinates are right
to left, so I assume I need to work out the width of the control b/c I want
to know if the mouse is within the first 16 pixels of the item, from the
left. Finally, I am trying to turn my screen relative point into a point
relative to the table view. Nothing I've tried in this regard, is doing
anything that resembles what I expect ( an x value between 0 and the width
of the control ). how do I do that?
Thanks as always
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