You might try changing your NSWindow
init method to the following:
window = [[NSWindow alloc]
initWithContentRect:NSMakeRect(0, 0, width, height)
styleMask:NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSResizableWindowMask
backing:NSBackingStoreBuffered defer:NO];
I believe that ORing in the additional masks automatically adds the corresponding buttons to the title bar for you: NSClosableWindowMask
adds the close button, NSMiniaturizableWindowMask
adds the minimize (center) button, and NSResizableWindowMask
adds the zoom (rightmost) button.