Mac OS X Minimum Window Size

Two questions here.

First question. On a Mac OS X application, the window is resized. My window contents are at a window size of 500x500. The problem is that the user can resize it, so part of the content is disabled. What do I need to do, the user can resize to the minimum size (in my case 500x500)?

Second question. When I close the Mac app (by clicking the red cross button on the top of the window), the app icon remains in the dock below. When the user clicks on him again, he will not start the application unless the user leaves the application and restarts it again. What settings do I need so that the user can close and restart it by clicking the dock icon?

thank

+5
source share
1 answer

Use - [NSWindow setMinSize:] to set the minimum size programmatically, but you can also set the minimum size inside Interface Builder (look at the size tab).

To close the application, to close the application, you need to add it to your application delegate:

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
{
    return YES;
}
+25
source

All Articles