• 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
Re: [NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)


  • Subject: Re: [NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)
  • From: Stéphane Sudre <email@hidden>
  • Date: Thu, 26 Jun 2008 22:54:00 +0200


On Jun 26, 2008, at 10:30 AM, Manfred Schwind wrote:

I'm beginning to wonder if it's possible to save and restore the current disclosure state of the hierarchy of a NSOutlineView.

I solved this a while ago. Here is what I am doing:

I am saving in my model if an item is expanded or collapsed. To keep the model up-to-date, I am doing the following:

- In outlineViewItemDidExpand: I am setting my expanded flag in the model to YES.
- In outlineViewItemWillCollapse: I am checking if the item is currently "visible" and only if it's visible, I set my expanded- flag to NO. To check if it is "visible" I am going up in the hierarchy and look if some of the parents is collapsed. If one is not expanded, I do not change the expanded flag. E.g. like so:


[...]

Looks like a good solution. I will try that.

Thanks.


_______________________________________________

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


References: 
 >[NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded) (From: Stéphane Sudre <email@hidden>)
 >Re: [NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded) (From: Manfred Schwind <email@hidden>)

  • Prev by Date: Re: NSTextFieldCell subclass template image inversion
  • Next by Date: Re: Leak in NSSavePanel
  • Previous by thread: Re: [NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)
  • Next by thread: Re: [NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)
  • Index(es):
    • Date
    • Thread