Re: Drag & Drop in an NSOutlineView

2011-03-14 Thread Corbin Dunn
On Mar 14, 2011, at 12:33 PM, Quincey Morris wrote: > On Mar 14, 2011, at 12:20, Carter R. Harrison wrote: > >> I'm having trouble getting drag and drop to work with an NSOutlineView. >> What I've done is below. The problem is that >> "tableView:writeRowsWithIndexes:toPasteboard" never gets

Re: Drag & Drop in an NSOutlineView

2011-03-14 Thread Carter R. Harrison
Ack! I can't believe I missed that. The correct method to implement is: - (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pboard Once I changed the method declaration and a few of the implementation details drag and drop is now working!

Re: Drag & Drop in an NSOutlineView

2011-03-14 Thread Quincey Morris
On Mar 14, 2011, at 12:20, Carter R. Harrison wrote: > I'm having trouble getting drag and drop to work with an NSOutlineView. What > I've done is below. The problem is that > "tableView:writeRowsWithIndexes:toPasteboard" never gets called. I found a > few people with the same issue and it s

Re: Drag & Drop in an NSOutlineView

2011-03-14 Thread Carter R. Harrison
The custom cell I'm using is a modification of "ImageAndTextCell" from the DragNDropOutlineView sample project. In that class they have some comments that describe how "hitTestForEvent:inRect:ofView:" works. It's my understanding that if I return anything other than NSCellHitTrackableArea a d

Re: Drag & Drop in an NSOutlineView

2011-03-14 Thread Corbin Dunn
Your custom cell needs to properly implement: - (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView NS_AVAILABLE_MAC(10_5); See the header for details or the AnimatedTableView demo. --corbin On Mar 14, 2011, at 12:20 PM, Carter R. Harrison wrote:

Drag & Drop in an NSOutlineView

2011-03-14 Thread Carter R. Harrison
I'm having trouble getting drag and drop to work with an NSOutlineView. What I've done is below. The problem is that "tableView:writeRowsWithIndexes:toPasteboard" never gets called. I found a few people with the same issue and it seems that the cause of the problem is that I am using a custo