We set the main window controller as both delegate and data source for the
outline view.  shouldSelectItem in the delegate handles clicks.  For right
clicks, we had to add code in the view.  It was pretty straightforward.

Apple has a sample project, but it's outdated and not very useful.

Casey McDermott
TurtleSoft.com


> Message: 1
> Date: Wed, 18 Dec 2019 17:22:27 +0100
> From: Jeff Younker <j...@drinktomi.com>
> To: cocoa-dev@lists.apple.com
> Subject: Preferred methods for usig NSOutlineView
> Message-ID:
>         <
> caj1dbsbgb+7ez02qx-lp1x3ee3qw0a_e1nzqpgte8y8r72x...@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> I've been playing around with the NSOutlineView, and as seems to be the
> usual case, the documentation from Apple is seriously deficient.
>
> I've been trying to use bindings to a tree controller, but I'm having
> difficulty getting element selection to work. I'm guessing that this would
> be done by binding to the tree controller using "Selection Index Paths
> (...)", but exactly what needs to be done there is unclear.
>
> Is there a worked-through example using interface builder and
> outlineview-treecontroller bindings, or should I give up on bindings and
> start using NSOutlineViewDelegate and rampant NSOutlineView subclassing?
>
> -jeff
>
>
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to