Re: Fastest way to "ExpandAll" in NSOutlineView
Re: Fastest way to "ExpandAll" in NSOutlineView
- Subject: Re: Fastest way to "ExpandAll" in NSOutlineView
- From: Darkshadow <email@hidden>
- Date: Tue, 6 Jun 2006 04:03:29 -0400
On Jun 06, 2006, at 2:07 AM, James Bucanek wrote:
Sanford Selznick wrote on Monday, June 5, 2006:
I'd like to expand-/collapse-all cells in an NSOutlineView
programmatically. The code below runs fine, but is slow once there
are more than a few hundred rows in the NSOutlineView.
Try using
[tableView expandItem:rootItem expandChildren:YES]
or
[tableView collapseItem:rootItem collapseChildren:YES]
Those will only expand or collapse the root item's children, and not
children of the children (and so on), though. That's probably fine,
from the user's point of view. Just wanted to point that out.
I don't know if this will speed up the code any, but you can do a
test to see if an item is expandable, then expand or collapse it if
it is.
for (int c = 0; c < [ov numberOfRows]; c++) {
id item = [ov itemAtRow:c];
if ( [ov isExpandable:item] ) {
if ( expand ) {
[ov expandItem:item];
} else {
[ov collapseItem:item];
}
}
}
Darkshadow
(aka Michael Nickerson)
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden