Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

convertPoint mouseLocationOutsideOfEventStream



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.