• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSOutlineView won't act as drag source
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView won't act as drag source


  • Subject: Re: NSOutlineView won't act as drag source
  • From: Pete Yandell <email@hidden>
  • Date: Wed, 6 Aug 2003 12:07:28 +1000

John,

You can only start a drag in an NSOutlineView by dragging in the column marked with setOutlineTableColumn:, which is the first column by default. Trying to drag from column 3 won't work.

I have no idea why NSOutlineView is implemented this way, and I've not yet been able to find a workaround.

Pete Yandell
http://pete.yandell.com/

On Wednesday, August 6, 2003, at 04:39 AM, john terranova wrote:

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.
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSOutlineView won't act as drag source
      • From: john terranova <email@hidden>
References: 
 >NSOutlineView won't act as drag source (From: john terranova <email@hidden>)

  • Prev by Date: Re: am i loading this pdf data correctly or not?
  • Next by Date: Borderless window
  • Previous by thread: NSOutlineView won't act as drag source
  • Next by thread: Re: NSOutlineView won't act as drag source
  • Index(es):
    • Date
    • Thread