Does Cocotron support complex tree controls?

52 views
Skip to first unread message

André Pareis

unread,
May 25, 2012, 3:52:33 PM5/25/12
to cocotr...@googlegroups.com
Hi Cocotronians,

I need a tree control in my application with custom node types (specific editing behavior), node images and drag-and-drop support. I started with NSTreeController but I figured out it is not implemented in Cocotron. Not a big problem as it wouldn't have helped with the custom node types anyway.

Later I found the nice Apple example DragNDropOutlineView which is very close to what I need. However, I just found out that it requires stuff that is missing in Cocotron. As far as I can see it would require support for @protocol NSPasteboardWriting, NSPasteboardReading which are not available and it makes use of  @class NSTreeNode but I found the corresponding NSTreeNode.h in Cocotron AppKit to be completely empty.

So, my question is, do I have any chance to get such a tree control working with Cocotron as it is today? Do I just need to switch over to NSOutlineViewDataSource and NSOutlineViewDelegate or is there more to it?

Thanks!

Christopher Lloyd

unread,
May 25, 2012, 5:31:00 PM5/25/12
to cocotr...@googlegroups.com
Hey André,

These classes/protocols seem fairly easy to add, I would take the approach of just adding them to Cocotron yourself and going along that path. Is there some piece which you think is particularly troublesome?

Chris

André Pareis

unread,
May 25, 2012, 6:02:37 PM5/25/12
to cocotr...@googlegroups.com
Implementing these classes seems to be doable. Thank you for encouraging me ;) 

With regard to the question that is troubling me the most - I am just totally unsure with the NSOutlineView in Cocotron. My NSTreeController prototype was working in Cocoa but it failed in Cocotron. Do I need to take the NSOutlineViewDataSource/Delegate approach instead? Are these binary "compatible" with Cocoa with their Cocoa counterparts?
Reply all
Reply to author
Forward
0 new messages