Re: Dragging NSCells
Re: Dragging NSCells
- Subject: Re: Dragging NSCells
- From: James DiPalma <email@hidden>
- Date: Thu, 23 Jan 2003 18:06:48 -0800
From: The Amazing Llama <email@hidden>
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@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.