Closed jdrukman closed 10 years ago
I'm trying to figure this out, how did you fix it?
I forgot to call [sourcelist registerForDraggedTypes:]
. Once you do that, you only need to implement -(NSDragOperation)sourceList:(PXSourceList *)sourceList validateDrop:(id<NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(NSInteger)index
and -(BOOL)sourceList:(PXSourceList *)aSourceList acceptDrop:(id<NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index
Ah great, thanks!
Yep, thanks for the write-up! PXSourceList basically mirrors how NSOutlineView and NSTableView work with regards to drag-n-drop.
I have a master-detail type of app using PXSourceList as an itunes-type sidebar. I want to be able to drag from a tableview on the detail pane to an item on the sourcelist. (Think iTunes add to playlist functionality.) I am using a view-based PXSourceList. I can initiate a drag from within the sourcelist if I implement sourceList:writeItems:toPasteboard:, but that's not what I want. I want it to accept a drag from outside itself. Is that even possible? Right now I have implemented all 3 methods but neither acceptDrop nor validateDrop is being called.