views:

530

answers:

3

Is there a way to preserve window position in Interface Builder? Every time I reopen a nib file, the MainWindow.xib window finds its way back to the top left of the screen, behind the window containing the interface I'm laying out. Moving it back to where I had it before every time is starting to get on my nerves. Seems like there should be an easy way to do this, but if there is I haven't been able to find it.

Thanks!

A: 

For the window, have a look at this inspector palette screen in Interface builder you can set the initial position here.

Abizern
A: 

It's not the position of my app's window at runtime that I want to control, but rather the windows belonging to Interface Builder itself. Specifically, the MainWindow.xib file (the one that contains the icons for File's Owner, First Responder, etc.).

Appreciate the answer though (and am now off to testdrive QuickSnapper...)

richBossa
Sorry I misunderstood your question, and I'm glad to have introduced you to QuickSnapper/Littlesnapper.
Abizern
+1  A: 

Interface Builder does not save window location/size on a per-nib basis, but it does automatically remember the size and position of the last nib window and uses that when opening future nib files. For example, if I open up nib file A, change its window's position, and then quit IB, then open up nib file B, its nib window shows up with the same location/size I had set for nib file A.

However, it appears that Interface Builder also cascades multiple windows down and to the right slightly when you open them up, so that a second nib file's window doesn't appear directly on top of one that's already open - makes sense. The problem appears to be that if you have a nib window positioned all the way at the bottom of the screen, so there's not enough room to open the next nib window, it results in the window being placed all the way at the top of the screen. Then of course once that happens, IB remembers that window position as the default, so subsequent windows also get opened at the top of the screen.

So, the "solution" is a) file an enhancement request on Bug Reporter to remember per-nib window positions :-), and b) in the meantime be careful about positioning your windows too close to the bottom of the screen.

Brian Webster