NSOutlineView won't act as drag source
NSOutlineView won't act as drag source
- Subject: NSOutlineView won't act as drag source
- From: john terranova <email@hidden>
- Date: Tue, 5 Aug 2003 11:39:45 -0700
Ok, I'm running out of ways to remove code to make my outline view be
as uncustomized as possible. Instead of using my subclass of
NSOutlineView, I use NSOutlineView itself (set in IB). Instead of
using my subclass of NSTableColumn, I use NSTableColumn itself (set in
IB). I took out all my code that adds and removes columns, just to
simplify things. I looked through the DragNDropOutlineView example as
a guide. I compared to a much earlier version of my project which uses
an NSTableView, before I switched to NSOutlineView. The NSTableView
version works.
No matter what I do, my outline view will not act as a drag source,
i.e. - (BOOL)outlineView:(NSOutlineView *)olv
writeItems:(NSArray*)items toPasteboard:(NSPasteboard*)pboard never
gets called.
I stepped through -[NSTableView _performDragFromMouseDown] and here is
what I saw (I know that these are not public interfaces, but stepping
through them is still interesting):
-[NSOutlineView _dataSourceRespondsToWriteRows] returns 1 - sounds good
-[NSOutlineView _isPoint:inDragZoneOfRow:] return 0 - sounds bad
Inside of -isPoint:inDragZoneOfRow: this is what I saw:
columnAtPoint returns 3 (the column I clicked in)
this column is compared to -[NSOutlineView outlineTableColumn]
if they are not equal, then _isPoint:inDragZoneOfRow: returns 0
immediately
if they are equal, then _isPoint:inDragZoneOfRow: checks isFlipped,
gets the frameOfCellAtColumn:row:, and calls NSMouseInRect, which
returns 0, causing _isPoint:inDragZoneOfRow to return 0
Any idea what's going on? What am I missing? All the docs I've read
say that the writeItems message is sent when the view determines that a
drag operation is starting. How does the view determine that a drag
operation is starting? What are the conditions for starting a drag in
an outlineview? I must have done something at some point which fails
one of these conditions for starting a drag, but I can't find it. I'm
not sure what else I can undo in my code and nib to have a plain,
generic outline view, short of just starting fresh with a new
outlineview.
Any help is greatly appreciated.
john
_______________________________________________
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.