nsdragginginfo

Drag and drop in an NSView

感情迁移 提交于 2019-12-07 12:44:25
问题 I'm testig drag and drop in an NSView, but draggingEntered: is never called. code : #import <Cocoa/Cocoa.h> @interface testViewDrag : NSView <NSDraggingDestination> @end @implementation testViewDrag - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { [self registerForDraggedTypes:[NSImage imagePasteboardTypes]]; NSLog(@"initWithFrame"); } return self; } -(NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender { NSLog(@"draggingEntered"); return

Drag and drop in an NSView

一笑奈何 提交于 2019-12-05 19:08:42
I'm testig drag and drop in an NSView, but draggingEntered: is never called. code : #import <Cocoa/Cocoa.h> @interface testViewDrag : NSView <NSDraggingDestination> @end @implementation testViewDrag - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { [self registerForDraggedTypes:[NSImage imagePasteboardTypes]]; NSLog(@"initWithFrame"); } return self; } -(NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender { NSLog(@"draggingEntered"); return NSDragOperationEvery; } -(NSDragOperation) draggingUpdated:(id<NSDraggingInfo>)sender { NSLog(@"draggingUpdated");