Q: How do you add other pasteboard types to an HFS Promise drag in Cocoa? A: NSView's -dragPromisedFilesOfTypes:fromRect:source:slideBack:event: method doesn't provide a means to add other pasteboard types to the HFS Promise data, because it doesn't expose the pasteboard that it uses. However, there is a workaround to add other pasteboard type data. -dragPromisedFilesOfTypes:fromRect:source:slideBack:event: calls NSView's -dragImage:at:offset:event:pasteboard:source:slideBack: method in its implementation. So, you can override -dragImage:at:offset:event:pasteboard:source:slideBack: , add any additional pasteboard types you need, and then call super's -dragImage:at:offset:event:pasteboard:source:slideBack: to allow everything to continue as before.
[Sep 15, 2003]
|