PDA

View Full Version : Coordinates of NSViews inside NSTabView




sigjuice
Mar 15, 2009, 05:31 PM
I'm having trouble understanding the coordinates of the NSViews inside an NSTabView. To create the extremely simple XIB that I have attached,

- Run Interface Builder and create a new XIB (Cocoa Application Template)
- Set the window's width to 346 and height to 362 in its size inspector
- Place an NSTabView on the window. Resize and position the NSTabView so that it snaps to the blue guides along all the edges of the window.

Here are all the coordinates from all the size inspectors
Content View (0, 0)
Top Tab View (20, 20)
NSView (10, 333)
NSView (10, 333)

I'd appreciate it a lot if I could get some help understanding where the (10, 333) comes from.

Thanks!



kainjow
Mar 15, 2009, 06:25 PM
The view is set as a subview within the tabview, and its origin is (10, 333). 10 px from the left, and 333 from the top (tab views use flipped coordinates). Here's a clearer example:

162536