NSOutlineView force expansion/refresh?
NSOutlineView force expansion/refresh?
- Subject: NSOutlineView force expansion/refresh?
- From: "Michael Hanna" <email@hidden>
- Date: Wed, 16 Jul 2008 15:22:30 -0700
I'm using observeValueForKeyPath:ofObject:change:context: to detect
when a change occurs in my data model. When a non-leaf node gets
added, the outline view draws the new item, but in an unexpanded
state. I try this code:
[m_rulesOutlineView noteNumberOfRowsChanged];
// expand all items in outline view
int c;
for (c = 0; c < [m_rulesOutlineView numberOfRows]; c++)
{
id item = [m_rulesOutlineView itemAtRow:c];
[m_rulesOutlineView expandItem:item];
[m_rulesOutlineView
setNeedsDisplayInRect:[m_rulesOutlineView rectOfRow:c]];
}
in order to expand the new item. The new item expands(i.e. the
triangle points downward) but the leaf nodes aren't actually drawn.
The user has to undisclose, then disclose the new triangle in order to
see the children.
I have tried calling this code in the next event loop by doing this:
[self performSelector:@selector(refreshRulesTreeView)
withObject:nil afterDelay:0.0];
to no avail. Also, calling -reloadData results in an assertion in
NSOutlineView.m ...
any help?
Michael
_______________________________________________
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