Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does “initial position” do in Xcode's nib editor?

Editing my nib for a document-based Cocoa application, I see that when I have a window or panel selected, Xcode lets me set its “initial position”:

Screenshot of a window in the nib, selected, and the “Initial position” pane in the Size Inspector.

This is separate from the window's Frame, which is above it, so what is this?

What uses the “initial position”, and what do the two pop-up menus and their possible values mean?

When I run my app and my document creates the NSWindowController for this nib (the second of two), the window appears cascaded from the main document window, rather than at the initial position. Is this because my app is document-based (i.e., the “Initial Position” would be used by a window not owned by a document), or is there some other reason?

like image 664
Peter Hosey Avatar asked Oct 17 '11 21:10

Peter Hosey


1 Answers

The initial position is the position in the screen where the window will appear, by default. And the popups control how this position is altered if the user's screen size is different than yours.

Imagine the screen is a giant NSView, and your window is positioned within it. Initial position is the frame origin, and the popups are your autoresizing mask.

like image 176
Lily Ballard Avatar answered Nov 05 '22 08:11

Lily Ballard