NSTableView Dragging Issues
NSTableView Dragging Issues
- Subject: NSTableView Dragging Issues
- From: John Devor <email@hidden>
- Date: Sun, 5 Oct 2003 15:16:11 -0400
Hello,
I'm having trouble dragging rows in a tableview. I've got two of the
methods set up correctly (I think) but one of them is giving me a
headache. Here's what I've got so far:
- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray *)rows
toPasteboard:(NSPasteboard *)pboard
{
_draggedArray = rows; // _draggedArray is a pointer to an array
[pboard declareTypes:[NSArray arrayWithObjects:
DragDropSimplePboardType, nil] owner:self];
[pboard set
Data:[NSData data] forType:DragDropSimplePboardType];
return YES;
}
- (NSDragOperation)tableView:(NSTableView *)tableView validateDrop:(id
<NSDraggingInfo>)info proposedRow:(int)row
{
// I've really know idea what should go in here.
}
- (BOOL)tableView:(NSTableView *)tableView acceptDrop:(id <NSDragging
Info>)info row:(int)row
dropOperation:(NSTableViewDropOperation)operation
{
return YES; // I think this should work for now.
}
I've checked Apple's DragNDropOutlineView example, but I found it
rather cluttered and confusing. Oh, and I'm managing an array of
objects if that matters (not just strings). If anyone has some source
I'd be most thankful :-) .
Thanks,
John D.
_______________________________________________
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.