Search code examples
objective-ccocoawindownswindowtitlebar

Hide buttons from titlebar in Cocoa


The Apples Human Interface Guidelines say:

macOS Human Interface Guidelines: Panels

How do I make the very first titlebar in that image (with only a close button). Disabling both Resize and Minimize in IB only make the resize/minimize buttons get disabled. But I want them to disappear. How can I do that?


Solution

  • I believe this should work:

    [[window standardWindowButton:NSWindowCloseButton] setHidden:YES];
    [[window standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES];
    [[window standardWindowButton:NSWindowZoomButton] setHidden:YES];