Skip navigation.
 
mlRe: Dragging NSCells
FROM : James DiPalma
DATE : Fri Jan 24 03:06:48 2003

> From: The Amazing Llama <<email_removed>>
>
> For the record, I'm trying to implement dragging items in a tree view
> around within the tree view, or out to other tree views of the same
> type. I have sub-classed NSMatrix and NSBrowserCell, and hope
> implementing either to accept the drops. NSMatrix, being a view, will
> not be hard; but NSBrowserCell, being a cell, has none of the
> abilities I need.


What is a tree view?

If you mean an NSOutlineView like view, are you having trouble using
NSOutlineView's dragging support? There is probably a sample project on
your machine at

   /Developer/Examples/Cocoa/DragNDropOutlineView

If you mean an NSBrowser like view, I've implemented one and would
start by saying: it probably wasn't worth it and would completely
rewrite NSBrowser instead of subclassing it. Summary of what I did:
   - add drag support to an NSMatrix subclass
   - use this matrix class in an NSBrowser subclass
   - handle drop in NSBrowser (for drags outside of contained matrixes)

Biggest problems:
   - getting mouseDown: to behave correctly for all types of matrixes
   - handling data reloading efficiently and effectively
   - getting selection change notifications for both NSMatrix and
NSBrowser


           -jim
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlDragging NSCells The Amazing Llama Jan 23, 02:46
mlRe: Dragging NSCells Andrew Thompson Jan 23, 03:13
mlRe: Dragging NSCells James DiPalma Jan 24, 03:06