On 13 Apr 2010, at 5:30 AM, Jack Carbaugh wrote:

> What would be the easiest way to convert the frame rect of a button in a 
> window to a screen rect ?

Search the documentation for symbols beginning with "convert"; among the 
results:

> convertBaseToScreen:
> 
> Converts a given point from the window’s base coordinate system to the screen 
> coordinate system.
> 
> - (NSPoint)convertBaseToScreen:(NSPoint)point
> 
> Parameters
> 
> point
> The point expressed in the window’s base coordinate system.
> 
> Return Value
> 
> point expressed in screen coordinates.
> 
> Availability
> 
>       • Available in Mac OS X v10.0 and later.

It converts NSPoints, but you can do the math. You may want to start with the 
bounds rect of the button, and use -[NSView convertPoint:toView:] with the 
second argument nil; it will keep working if you ever move the button to an 
enclosing view.

        — F

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to