Re: 'Static' items in an NSOutlineView
Re: 'Static' items in an NSOutlineView
- Subject: Re: 'Static' items in an NSOutlineView
- From: Quincey Morris <email@hidden>
- Date: Mon, 17 Oct 2011 21:19:40 -0700
On Oct 17, 2011, at 19:58 , Koen van der Drift wrote:
> What it should look like is:
>
> LIBRARY (static)
> Group1
> Group2
>
>
> FAVORITES (static)
> Group3
> Group4
>
> RECENT (static)
You've missed something basic. In the above example (modeled as you previously explained on the source lists in iTunes and Mail), there are multiple levels of hierarchy of the data that represents the list content.
At the root level is the root item, which is represented by a nil NSOutline item in your data source methods. It doesn't get displayed, but its children do. If you're using a tree controller, this root level doesn't exist.
At the next level are the content groupings, of which there are 3: Library, Favorites and Recent. This is the topmost level when using a tree controller.
At the next level are the children of the content groupings. Group1 and Group2 are children of Library; Group3 and Group4 are children of Favorites; Recent has no children.
Below those levels, your groups may have their own children.
What you're mis-calling "static groups" are actually parent items of the real group items. The reason there are no disclosure triangles is that these top-level groups are *always* expanded, and have their disclosure triangle suppressed via the delegate method I mentioned in an earlier email.
Also, regarding sorting of items at the same level, if there is no sort descriptor in control, the order of the items is the order in which your data source methods associate items with child indexes (if you're using a data source) *or* the order of the child item array in each parent (if you're using a tree controller).
_______________________________________________
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