Drag&Dropping in outlineViews
Drag&Dropping in outlineViews
- Subject: Drag&Dropping in outlineViews
- From: Roberto Esposito <email@hidden>
- Date: Fri, 2 May 2003 14:57:00 +0200
Hi,
I searched the docs and had a look to the examples in the Developer
folder, but I'm still puzzled about allowing an outline view to
handling drag and drop.
In the outline view I implemented the following methods as follows:
- (BOOL)outlineView:(NSOutlineView *)outlineView
writeItems:(NSArray*)items toPasteboard:(NSPasteboard*)pboard {
NSLog(@"dragging");
[pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType]
owner:nil];
[pboard setString:@"prova" forType:NSStringPboardType];
return YES;
}
- (BOOL)outlineView:(NSOutlineView*)olv acceptDrop:(id
<NSDraggingInfo>)info item:(id)item childIndex:(int)index {
NSLog(@"acceptDrop");
return YES;
}
- (unsigned int)outlineView:(NSOutlineView*)olv validateDrop:(id
<NSDraggingInfo>)info proposedItem:(id)item
proposedChildIndex:(int)childIndex {
NSLog(@"validateDrop");
return NSDragOperationGeneric;
}
The implementation is trivial since I'm only testing if everything
works before starting the hard part. The problem that puzzles me is
that outlineView:acceptDrop:item:childIndex: and
outlineView:validateDrop:proposedItem:proposedChildIndex: are never
called even if the first method is actually called. I don't know if I
have to implement something more to enable the desired behavior...
Any ideas?
Thanks in advance,
Roberto
_______________________________________________
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.