Re: Row dragging ...
Re: Row dragging ...
- Subject: Re: Row dragging ...
- From: mmalcolm crawford <email@hidden>
- Date: Sat, 31 Jan 2004 15:03:45 -0800
On Jan 31, 2004, at 1:44 PM, J Nozzi wrote:
I've been searching and searching and unable to find a clear,
concise answer to the following:
How in the world do you make an NSTableView able to respond to row
drags? I want the user to be able to re-order rows (not columns) with
a drag operation.
If anyone has a very simple explanation, I'd be most appreciative.
This is a "work in progress"(*), but it may be helpful:
<
http://homepage.mac.com/mmalc/CocoaExamples/
TableViewDnDController.zip>
It illustrates use of an NSArrayController in conjunction with a
"classic" document controller serving as the table view's delegate to
allow drag and drop, and re-ordering, of multiple selections in a
tableview.
In part it builds on the code sample Daryn posted yesterday to move
objects in an array to a new index, but uses an NSIndexSet. It also
shows how appropriate use of indexed accessor methods ensures that
modifications to the content array are properly reflected in the
tableview.
mmalc
(*) The main thing that isn't working properly in all cases is
selection of rows after a move. I need to wake up a little to think
about it...
_______________________________________________
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.