Re: NSOutlineView expanded state persistence
Re: NSOutlineView expanded state persistence
- Subject: Re: NSOutlineView expanded state persistence
- From: Michael McCracken <email@hidden>
- Date: Wed, 28 Jan 2004 23:40:01 -0800
Continuing the thread - hopefully this will be useful info for someone
else...
Looking into some open source cocoa projects (Adium, Fire, Nitro for
Jabber) which had dynamically changing outline views, they all use a
scheme where they keep track of expanded state in the model objects -
and it was always a bunch of extra code to save state before a [ov
reloadData] and restore it just after.
I'm not afraid of extra code, I just wanted to hear if this sort of
setup was the Right Way. It seemed like it should be easier.
If anyone has any comments on this, I'd be glad to hear them.
Thanks!
-mike
On Jan 27, 2004, at 5:42 PM, Michael McCracken wrote:
My question is now simpler:
Is there any easy way to keep the data for an outlineview in a
structure that gets replaced by new data (that is often functionally
the same, and sometimes actually equivalent to the old data) before
every time reloadData is called, without losing the expanded state?
-mike
On Jan 27, 2004, at 4:14 PM, Michael McCracken wrote:
Hi, Thanks, but I'm afraid this doesn't quite solve my problem,
because as it is now the data objects are completely replaced during
refresh (every time text changes, and immediately before calling
reloadData) So, saving the expanded state there seems hard.
It seems like I'd have to keep the old data around, and attempt to
compare the newly built one with the old one, then set the flags
appropriately in the new one, and finally tell the view to expand all
the ones that were set.
I'm interpreting the lack of responses as either I'm using
NSOutlineView unconventionally or that it's just not well understood
what it does...
-mike
On Jan 27, 2004, at 2:34 AM, sunil kumar wrote:
Hi Michael,
To keep the OutlineView as it is even after u reloaded it ,i
think, u should keep a flag with in your objects so that when u
reload it u should check whether the object is in expanded state or
not.
Hope u understood it.
Sunil Kumar G
Programmer
Effigent India Pvt.Ltd
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.