简体   繁体   English

如何在Cocoa Mac Os X应用程序的NSTableView中为用户提供快速浏览体验?

[英]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. 它是NSPanelNSWindow的子类,因此可以使用-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.

相关问题 以编程方式快速查看Mac OS X中的图像 - Programmatically quicklook images in Mac OS X 如何在 OS X Cocoa 应用程序中使用 Google 授权用户 - How to authorize user with Google in OS X Cocoa application 如何在MAC OS X应用程序中更改NSTableView标头背景颜色? - How to change NSTableView header background color in MAC OS X app? 在OS X应用程序中填充NSTableView - Populating NSTableView in OS X Application Mac OS X可可应用程序中的互联网连接通知 - Notification for internet connection in Mac OS X cocoa application Mac OS X Cocoa 单 window 应用架构 - Mac OS X Cocoa single window application architecture 在cocoa mac OS X应用程序中分享facebook和twitter中的文本? - Share text in facebook and twitter in cocoa mac OS X application? 在运行应用程序时,如何使用我在Mac OS X Cocoa App中放入Xcode的文件? - How do I use files that I dropped into Xcode in a Mac OS X Cocoa App when running the application? 在Cocoa Mac Os X Objective-C应用程序中,如何在PDFView当前显示的pdf页面中实现搜索? - In a Cocoa Mac Os X Objective-C Application, How to implement a Search in the pdf page currently displayed by a PDFView? 如何在Mac OS X中使用Cocoa和CGDisplayCreateImageForRect截取区域截图? - How to take region screenshot in Mac OS X using Cocoa and CGDisplayCreateImageForRect?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM