• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSOutlineView with NSTreeController bindings - default expansion for nodes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSOutlineView with NSTreeController bindings - default expansion for nodes


  • Subject: NSOutlineView with NSTreeController bindings - default expansion for nodes
  • From: Luke Evans <email@hidden>
  • Date: Sun, 10 Feb 2008 16:25:29 -0800

I have not yet found anything in the docs indicating a way to set the default expansion state for outline nodes introduced into my tree from my model (via the bound NSTreeController).

Of course I can find out when an outline node is about to be displayed, and could arrange for the newly added item to be expanded 'later' (performing this on a later runloop event), but in order to avoid having the given item always expanded, I'd have to record whether or not this has been done before - probably in my model object, which seems wrong (e.g. what if I want to use my model objects in several trees, and why should my model object really be maintaining state about the view?).

If I'm only concerned about the top level (root) objects, then I can presumably whip through these expanding them, once the control is initialised and the NSTreeController has its content, but even this would not interact too favourably if I've opted to persist the state with autosaveExpandedItems.

Really, I need some way to determine that an item is being added to the outline for the very first time to have an opportunity to assert its initial expansion state, but never touch it again thereafter. At the moment, this is looking quite awkward, but perhaps there's some magic...?

-- Lwe
_______________________________________________

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


  • Prev by Date: Re: self = [super init] debate. - Thanks
  • Next by Date: -[NSFileHandle waitForDataInBackgroundAndNotify] versus CFFileDescriptor
  • Previous by thread: Re: Asynchronous Distributed Object Calls
  • Next by thread: -[NSFileHandle waitForDataInBackgroundAndNotify] versus CFFileDescriptor
  • Index(es):
    • Date
    • Thread