convertPoint mouseLocationOutsideOfEventStream
convertPoint mouseLocationOutsideOfEventStream
- Subject: convertPoint mouseLocationOutsideOfEventStream
- From: Claus Atzenbeck <email@hidden>
- Date: Mon, 30 Jul 2007 17:24:39 +0200 (CEST)
Hi all:
I have a custom view. At one point in my app I would like to get the
mouse pointer position (in my custom view's coordinates) without having
a mouse event.
I need the same coordinates as this would give me (from within my custom
view), but without mouse event, as mentioned:
[self convertPoint:[event locationInWindow] fromView:nil];
I can get the mouse position in the window's coordinate system:
[[self window] mouseLocationOutsideOfEventStream];
However, how can I convert it into my custom view's coordinate system?
I thought it would be something like that (called from within my custom
view):
[self convertPoint:[[self window] mouseLocationOutsideOfEventStream]
fromView:nil];
This does deliver not the desired coordinates.
[NSWindow convertBaseToScreen] before convertPoint does not help either.
Any idea how to receive the current mouse location in my custom view's
coordinates without using NSEvent?
Thanks,
Claus
_______________________________________________
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