Coordinates of NSViews inside NSTabView

Discussion in 'Mac Programming' started by sigjuice, Mar 15, 2009.

  1. macrumors member

    Joined:
    Mar 14, 2008
    #1
    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!
     

    Attached Files:

  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    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:

    tabs.png
     

Share This Page