NSWindow的dragImage的例子?
我正在寻找 NSWindow 的 DragImage 方法的解释。
- (void)dragImage:(NSImage *)image at:(NSPoint)imageLocation offset:(NSSize)pointerOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pasteboard source:(id)sourceObject slideBack:(BOOL)slideBack
有什么帮助吗?
I'm looking for an explanation of NSWindow's dragImage method.
- (void)dragImage:(NSImage *)image at:(NSPoint)imageLocation offset:(NSSize)pointerOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pasteboard source:(id)sourceObject slideBack:(BOOL)slideBack
Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该方法的 NSView 文档提供了更详细的解释,包括示例代码。这两种方法之间的唯一区别是
imageLocation
所在的坐标系。在 http://developer.apple.com/library/mac/documentation/Cocoa/Reference /ApplicationKit/Classes/NSView_Class/Reference/NSView.html#//apple_ref/doc/uid/20000014-SW135编辑:以下是该链接中的示例代码,并添加了注释。
源对象(在本例中为 self )需要实现 NSDraggingSource 协议。您可能还对 NSPasteboard 类参考。
The NSView documentation of that method provides a much more detailed explanation, including example code. The only difference between the two methods is the coordinate system that
imageLocation
is in. Find it at http://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/Reference/NSView.html#//apple_ref/doc/uid/20000014-SW135Edit: Here is the sample code from that link, with added comments.
The source object (self in this case) needs to implement the NSDraggingSource protocol. You may also be interested in the NSPasteboard Class Reference.