Drag and drop: HELP PLEASE :)
Drag and drop: HELP PLEASE :)
- Subject: Drag and drop: HELP PLEASE :)
- From: email@hidden
- Date: Thu, 18 Apr 2002 11:43:18 EDT
I still have a problem with drag and drop, i want to do some drag and drop
between 2 views. The problem is that the destination view doesn't send the
draggingEntered message when we drag the image over it, here's my code for
setting the source
@implementation DragView //subclass of NSImageView
- (void) mouseDown:(NSEvent *)event
{
NSPasteboard *dragPboard = [ NSPasteboard
pasteboardWithName:NSDragPboard ];
[dragPboard declareTypes:[NSArray arrayWithObject:NSTIFFPboardType]
owner:self];
[dragPboard set
Data:[[self image] TIFFRepresentation]
forType:NSTIFFPboardType];
[self dragImage:[self image] at:[self bounds].origin offset:NSZeroSize
event:event pasteboard:dragPboard source:self slideBack:YES];
}
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)flag
{
return NSDragOperationCopy;
}
- (NSDragOperation)draggingEntered:(id <NSDragInfo>)sender
{
//I never enter here when i drag from another view of this same class
return NSDragOperationCopy;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.