Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable roll-out animation for NSOutlineView

Is there a way to stop the roll-out animation for an NSOutlineView. By 'roll-out' I mean the animation that happens when an item is expanded/collapsed, and the children slide down/up.

like image 426
TheSavage Avatar asked Mar 01 '14 15:03

TheSavage


1 Answers

Create a subclass of NSOutlineView and suppress animation:

-(void) expandItem:(id)item expandChildren:(BOOL)expandChildren
{
    [NSAnimationContext beginGrouping];
    [[NSAnimationContext currentContext] setDuration:0.0];

    [super expandItem:item expandChildren:expandChildren];

    [NSAnimationContext endGrouping];
}

Other methods are:

– expandItem:
– expandItem:expandChildren:
– collapseItem:
– collapseItem:collapseChildren:
like image 50
pointum Avatar answered Oct 24 '22 00:10

pointum