从/在webview中拖放文件 [英] Drag/Drop File from/in webview

查看:91
本文介绍了从/在webview中拖放文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个应用程序,像Mac邮件
,如果我们在消息区域中删除一个文件,然后该文件作为附件文件
,我们可以拖动该文件到桌面和双点击文件打开它。
我使用webview(我认为webview是用于mac邮件)

I am making an application featured like mac mail as in mac mail if we drop a file in message area then that file is as an attached file and we can drag that file to desktop and double click on the file to open it. I am using webview(I think webview is used in mac mail)

任何人都可以建议我如何做这

Can anybody suggest me how can I do this

感谢
Amit Battan

Thanks Amit Battan

推荐答案

将NSWebView子类化并实现NSDraggingDestination。我建议您阅读文档的拖放编程主题部分,了解更多关于如何正确注册NSPasteboard类型的文档。 (在10.6之前的OS X的NSFilenamesPboardType)

Subclass the NSWebView and implement NSDraggingDestination. I recommend you read thru the "Drag and Drop Programming Topics for Cocoa" section of the documentation to learn more about how to properly register for the NSPasteboard types you want. (NSFilenamesPboardType for OS X before 10.6)

这篇关于从/在webview中拖放文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆