[英]How to provide to the user a quicklook experience in a NSTableView in a Cocoa Mac Os X Application?
I work with some files in a NSTableView in my Desktop Application, and I would like to react to space bar keyboard shortcuts by providing a quickly experience for various kinds of files. 我在桌面应用程序的NSTableView中处理一些文件,并且我想通过提供各种文件的快速体验来对空格键的快捷键作出反应。 Is there any snippet available anywhere that can point me in the right direction ? 是否有任何片段可以指导我正确的方向?
Thanks for any help... ! 谢谢你的帮助... !
You can use QLPreviewPanel
for this. 您可以为此使用QLPreviewPanel
。 It's a subclass of NSPanel
and NSWindow
, so you can use -orderFront:
to show it. 它是NSPanel
和NSWindow
的子类,因此可以使用-orderFront:
进行显示。
Your controller class should implement the methods of the QLPreviewPanelController
informal protocol to declare that it can control a Quick Look preview panel and to be notified that it is the controller. 您的控制器类应实现QLPreviewPanelController
非正式协议的方法,以声明它可以控制“快速查看”预览面板,并被告知它是控制器。
When it is the controller, it can set the panel's delegate and/or data source. 当它是控制器时,它可以设置面板的代表和/或数据源。 It would implement the methods of the respective protocols to provide the items to preview. 它将实现相应协议的方法以提供要预览的项目。
Apple provides the QuickLookDownloader sample project to demonstrate its use. Apple提供了QuickLookDownloader示例项目来演示其用法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.