NSApplication orderFrontStandardAboutPanel:使我的“关于”面板稍微不那么标准
当 NSApplication 收到 orderFrontStandardAboutPanel 消息时,向标准 Cocoa about 对话框添加额外的任意数据(如果有),我有哪些选项(如果有的话)。
What are my options, if any, of adding additional, arbitrary data to the standard Cocoa about dialog that is displayed by an NSApplication when it receives a orderFrontStandardAboutPanel message.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您将名为
Credits.rtf
的文件添加到Resources
中,则内容将自动在扩展的标准“关于”面板中使用,您可以在文件中添加所需的任何信息。它仍然会从info.plist
中提取标准版权、版本信息等。这是我所知道的添加任意信息的最简单方法,否则您几乎将不得不推出自己的“关于”面板。If you add a file named
Credits.rtf
toResources
the contents will automatically be used in the expanded standard about panel and you can put whatever info you want in the file. It will still pull the standard copyright, version info, etc from theinfo.plist
. It is the easiest way I know of to add arbitrary info, otherwise you pretty much will have to roll your own about panel.NSApplication.AboutPanelOptionKey
NSApplication.AboutPanelOptionKey
进一步扩展上面 Darrell Root 和 theMikeSwan 的答案,Apple 文档 对于
NSApplication.AboutPanelOptionKey
的credits
属性来说:-Expanding further on the answers from Darrell Root and theMikeSwan above, Apple's documentation for the
credits
property ofNSApplication.AboutPanelOptionKey
states:-扩展MikeSwan的答案,我偶然发现,如果将名为Credits.html的文件添加到Resources文件夹中,它的内容将在扩展标准关于面板中使用。事实上,Credits.html 似乎覆盖了 Credits.rtf。
因此,您可以选择使用 html 还是 rtf 格式,或者将“关于”连接到完全不同的自定义窗口控制器。
Expanding on theMikeSwan's answer, by accident I found that if you add a file named Credits.html to the Resources folder, it's contents get used in the expanded standard about panel. In fact Credits.html appears to override a Credits.rtf.
So your choice whether to use html or rtf format, or wire up "About" to a completely different custom window controller.