Conditionally allowing multiple selections in NSOutlineView
Conditionally allowing multiple selections in NSOutlineView
- Subject: Conditionally allowing multiple selections in NSOutlineView
- From: Graham Cox <email@hidden>
- Date: Mon, 09 Jun 2014 14:46:52 +1000
An NSOutlineView's rows represent different objects. Some of these can have a multiple selection, and some can't. For example, child objects of a particular object can have a multiple selection within that group, but there can't be a multiple selection in different groups, nor can more than one group be selected at a time.
I have allowsMultipleSelection set to YES, but I need to restrict when a multiple selection is allowed or otherwise. The delegate can implement -outlineView:shouldSelectItem:, but that seems a bit too coarse, and also isn't passed the event (to check modifier flags). It's not that clear that checking the modifier flags would be enough to go on anyway. In addition, there's no case where a selection should be refused, but if there is one already it needs to become the only (single) selection in some cases.
Can anyone think of a way to achieve this?
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden