开发者

Drag and drop .app files into NSImageView and get the file path

开发者 https://www.devze.com 2022-12-08 17:25 出处:网络
I have an NSWindow containing and NSImageView. I want that the user can drag \'n drop a .app file (application) into the NSImageVie开发者_JS百科w, and my application see which file is dropped. Is ther

I have an NSWindow containing and NSImageView. I want that the user can drag 'n drop a .app file (application) into the NSImageVie开发者_JS百科w, and my application see which file is dropped. Is there a way to do this (okay, I'm sure there is a way to do this -_- but which one :p )?

So much like iWeb does it with image files.

A tutorial would be nice (english or dutch).

Thanks in advance.


  1. Subclass NSImageView
  2. Implement NSDraggingDestination protocol
  3. Register an instance of your subclass to accept your defined PBoardType

Here is a well written tutorial (it's a bit old, but maybe useful): http://www.cocoadevcentral.com/articles/000056.php

0

精彩评论

暂无评论...
验证码 换一张
取 消