Re: A bug with NSWindow's convertBaseToScreen: method ?
Re: A bug with NSWindow's convertBaseToScreen: method ?
- Subject: Re: A bug with NSWindow's convertBaseToScreen: method ?
- From: Johan Kool <email@hidden>
- Date: Wed, 18 Apr 2007 13:21:01 +0200
Mike,
Rick is right, this is not a bug. A view's frame is expressed in the
coordinates of it's encompassing view. So if the view is not a direct
subview of the window's contentview, you will first have to convert
the view's frame to that coordinate space.
In my first mail to you I did that:
NSRect rectInWindow = [sender convertRect:[sender frame] toView:nil];
NSPoint originOnScreen = [[sender window] convertBaseToScreen:
rectInWindow.origin];
I took it out in my subsequent mail, because in the case of your
sample app the sender's frame should not be converted to the windows
coordinates, because it already was a direct subview of it.
Hope this clears it up for you.
Johan
---
http://www.johankool.nl/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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