How to disable NSDocument's window title popup

谁说我不能喝 提交于 2019-12-05 03:40:44

I was able to prevent the button from being shown by overriding NSWindow's

+ (NSButton *)standardWindowButton:(NSWindowButton)windowButtonKind forStyleMask:(NSUInteger)windowStyle

and returning nil for NSWindowDocumentVersionsButton

Return false from NSDocument's autosavesInPlace() override

You can also use a streamlined toolbar (wwdc2016)

  override func viewWillAppear() {
        super.viewWillAppear()

        self.view.window!.titleVisibility = .hidden  
  }

This removes also the title bar (but not the ones of tabbed windows)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!