NSWindow 尝试关闭时显示警报
当 NSWindow 尝试关闭时如何显示 NSAlert?这也必须打开和关闭。
How can I display an NSAlert when an NSWindow attempts to close? This will also have to be turned on and off.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NSWindow 的委托有一个 windowShouldClose: 方法将允许您自定义此方法。还有 NSWindow 的 documentEdited 方法,可以让您将文档标记为具有未保存的更改,您可能对此感兴趣。
NSWindow's delegate has a windowShouldClose: method that will allow you to customize this. There's also NSWindow's documentEdited methods that let you mark a document as having unsaved changes, which might interest you.