• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
convertPoint mouseLocationOutsideOfEventStream
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Moveable/Resizable "Box" views and blurry frame
  • Next by Date: Re: Problems running a shell script as root
  • Previous by thread: Re: Moveable/Resizable "Box" views and blurry frame
  • Next by thread: Interface Builder question : frozen NSTextField
  • Index(es):
    • Date
    • Thread