• 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
Re: NSView's origin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView's origin


  • Subject: Re: NSView's origin
  • From: Shawn Erickson <email@hidden>
  • Date: Sun, 26 Nov 2006 18:34:37 -0800


On Nov 26, 2006, at 6:01 PM, Aaron Boothello wrote:

I have gone over the coordinate system stuff... but i can seem to find the method which return the origin of an NSView in a window. i know there is a method with lets you change the origin, but there's no where to determine where the origin actually is.

-[NSView frame] gives you the views frame which contains the origin of the view in its super views coordinate space and then use convertPoint:toView: to convert to window coordinates.


For example...
NSPoint originInWindowCoordinates;
originInWindowCoordinates = [self convertPoint:[myGLView frame].origin toView:nil];


...however you likely only need to do calculations in terms of the top level content view and if your gl views are all peers (have the same super view) you likely don't need to do any conversion of the frame.

-Shawn
_______________________________________________

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


References: 
 >NSView's origin (From: Aaron Boothello <email@hidden>)
 >Re: NSView's origin (From: Shawn Erickson <email@hidden>)
 >Re: NSView's origin (From: Aaron Boothello <email@hidden>)

  • Prev by Date: Re: NSView's origin
  • Next by Date: Re: NSView's origin
  • Previous by thread: Re: NSView's origin
  • Next by thread: Re: NSView's origin
  • Index(es):
    • Date
    • Thread