Window size question

I just finished the final build (Deploy) of my first AS Studio application. I put it together mainly on a PowerMac G4 that uses a 17 inch studio display. I finished it up on a 20 inch iMac. I went to test it on my iBook G4, and the window is too tall for the screen!! I actually thought that was pretty funny, but am now wondering if there are any recommendations on window sizes that I should keep in mind for the future?? I searched throught the menus in IB, as well as the help files, but located nothing there.

I appreciate any comments or direction.

Is there a reason why the window can’t become shorter? Maybe you should find how much screen space is available and size the window down if clips over the edge.

I can certainly do that, Qwerty, it’s no big deal, but what I want to know is if there are recommendations or actual numbers out there that one can reference to ensure that a main window is going to fit within the majority of potential user’s screens. I am not afraid of trial and error, and it will certainly solve the issue this time, and I can generate a window height that will be compatible with my 3 machines; I just wanted to know if anyone else had experienced this and could offer some guidance.

Can’t say I’ve much experience with the issue, but it is interesting. I looked at the Apple Human Interface guidelines, but they don’t mentions window or monitor sizes, nor do the books I have on interface design. I finally googled on “monitor ratio” and found the following on


Then, of course, you would need to allow room for the dock (which might be on the bottom or the side of the screen). The resize buttons in NSWindow seem to automatically resize based on the location of the dock, but not always.

Smaller the better, IMO. I do agree with qwerty, to some extent. Using a routine to check the window size and then fill it is “acceptable” assuming that the user might expect your app to do so. If your app has some “good reason” why it should be as big as possible all the time, then test the screen size and resize it for the user at launch/open. It’s not really usual behavior in most cases, though, so it may offend people to have the window take over the screen every time without their control. My preference, is to stand by the old boring tradition of 800x600 monitors, because some people still have their monitors at that res (like my grandma and my 5 year old :P). This gives you the peace of mind of knowing you’re not too small or too big, and that you’re not hogging the screen. Remember, people use macs because they can do lots of things with them at once. Forcing people to eat only off the plate you give them will certainly make people (like me) uncomfortable. If you’re developing an app for high-end graphic designers or other developers, I’m guessing you can expect higher resolutions. In cases such as games or media apps like iDVD for example, have obvious reasons why they need to use the whole screen. If you’ve got a big monitor, you know it, and should take into account that others maybe don’t have the same setup.

My recommendation:
Set the initial window size to 800x600 or less. Enable ‘autosave’ by simply giving your window an autosave name in IB. The window size and position are saved automagically for you in the user defaults, and are restored to the settings the user chooses when your app launches. That way the user can decide where they want the window, and you don’t need to do any checking or resizing the hard way. If you feel it’s important to override the users’ control, then you still want to start small, and then resize the window before it’s displayed (i.e. ‘on will open’ or ‘on launched’). NEVER make your window’s “minimum size” too big. Having a window trapped on screen that you can’t get to the resize handle or the title bar of is a big no-no.

The cocoa methods you’d need to use to get the screen size and resize the window account for this. You can choose to get the whole screen size or just the size that you should draw in to avoid drawing over the menu bar or dock.


Thank you for your input, everyone, I appreciate the counsel. I edited the window, and it is much smaller, and I like it much more, actually.

Glad to here it. :wink:

For the record, here are some Cocoa methods you might use to get the available screen frame:

// First, get your window's nsscreen object NSScreen *windowScreen = [mainWindow screen]; // Next, find the visible area for that screen NSRect visibleFrame = [windowScreen visibleFrame]; // Set the window's frame, redrawing its content [mainWindow setFrame: visibleFrame display:YES];
Sorry, haven’t got enough time to actually test it.

NSScreen methods and resizing has been covered many times…