static int window_create(int width, int height) { NSWindow *window; NSRect contentRect; unsigned int style; contentRect = NSMakeRect(0, 0, width, height); style = NSTitledWindowMask | NSMiniaturizableWindowMask | NSClosableWindowMask | NSResizableWindowMask; window = [[NSWindow alloc] initWithContentRect:contentRect styleMask:style backing:NSBackingStoreBuffered defer:NO]; [window center]; [window setViewsNeedDisplay:NO]; [window setTitle:@"Hello"]; [window makeKeyAndOrderFront:nil]; return 1; } int main(int argc, const char *argv[]) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; [NSApplication sharedApplication]; [NSApp setMainMenu:[[NSMenu alloc] init]]; setApplicationMenu(); window_create(400, 400); [pool release]; [NSApp run]; return 0; }