如何禁用NSDocument的窗口标题弹出窗口

如何禁用NSDocument的窗口标题弹出窗口

本文介绍了如何禁用NSDocument的窗口标题弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个启用了自动保存的基于NSDocument的应用程序。

I have an NSDocument based app with autosave enabled.

我想阻止此弹出窗口显示:

I'd like to prevent this popup from showing:

我尝试从NSWindow的–title,–representedFilename和–representedURL返回nil来隐藏标题有效地隐藏了标题,但对向下显示的披露指示器和弹出窗口没有影响。

I have tried returning nil from NSWindow's –title, –representedFilename and –representedURL which hide the title effectively hide the title but have no effect on the downward facing disclosure indicator and the popup.

有没有办法防止这种弹出窗口出现?

Is there a way I can prevent this popup from being presented?

推荐答案

我能够通过覆盖NSWindow来防止按钮被显示

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

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

并为 NSWindowDocumentVersionsButton

这篇关于如何禁用NSDocument的窗口标题弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 16:16