• 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
Converting to Window Coordinates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting to Window Coordinates


  • Subject: Converting to Window Coordinates
  • From: Dave <email@hidden>
  • Date: Tue, 21 Apr 2015 16:27:30 +0100

Hi All,

I have the following code in a Window Controller.

myWorkRect.origin = theGlobalPoint;
myWorkRect.size = NSMakeSize(1,1);
myWorkRect = [self.window convertRectFromScreen:myWorkRect];
myWindowPoint = myWorkRect.origin;

myCocoaControlView = [myContentView hitTest: myWindowPoint];

I have a Point in Global (Screen) space and I want to check if that point is inside a view of the associated window. I had hoped the code above would do the trick but it seems not.

The Global point is within a View in the Window, and when this code gets called hitTest always returned the Frame View (not the deepest View that intersects the point) as the documentation says, just to see what would happen, I overrode hitTest in the Content View and now it returns nil.

What am I do doing wrong?

Thanks a lot for any help,
All the Best
Dave


_______________________________________________

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: Re: Crash at iOS App Startup - What Could Have Gone Wrong?
  • Next by Date: Converting to Window Coordinates
  • Previous by thread: Re: Crash at iOS App Startup - What Could Have Gone Wrong?
  • Next by thread: Converting to Window Coordinates
  • Index(es):
    • Date
    • Thread