Disable deployment animations for NSOutlineView

Is there a way to stop deployment animations for NSOutlineView. By “deployment” I mean the animation that occurs when an element expands / collapses and the children slide up / down.

+4
source share
1 answer

Subclass NSOutlineView and suppress the animation:

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

    [super expandItem:item expandChildren:expandChildren];

    [NSAnimationContext endGrouping];
}

Other methods:

expandItem:expandItem:expandChildren:collapseItem:collapseItem:collapseChildren:
+7
source

Source: https://habr.com/ru/post/1529571/


All Articles