NSScrollView.scrollPoint scrolls visibly, if view gets displayed as a result of a cursor key press, but not if view is displayed as result of a mouse click

Bit of a handful that title, sorry ;)

My app has an NSOutlineView as a source list, and win selecting a node in the outline, it will show a new custom NSScrollView based view for the item. As part of showing the view, I restore the scroll position to a previous value, or a reasonable default.

Now here's the weird part;

this works fine when I *click* the NSOutlineView. I show my view, set the scroll position, and the view shows instantly.

However, when I instead use the cursor keys to move up and down between items in the outline view, rather than showing the right position instantly, the view will appear scrolled to one end, and then *visibly* scroll up or down (depending on the key that was pressed in the NSOutlineView) to the correct position.

Now, all I am doing is reacting to NSOutlineView's outlineViewSelectionDidChange delegate method, so none of my resulting code that shows the view even has any knowledge of *how* the selection changed (keyboard, mouse click, or whatever), at all. But yet, the NSScrollView behaves visually differently, as if it somehow "remembers" the keypress.

Does anyone have any idea what could be going on here, and — more importantly — how to prevent it?
AppKit sees the keyDown and tries to animation the scroll. Try setting up the scrollView with a [[NSRunLoop mainRunLoop] performBlock:]
Thanx. I was contemplating that as a fallback. But I'm curious as to how the scrollview (ways detached from the actual event, can still "see" the keypress,...

ps: doesn't help :(.
Correction, this seems to fix is 80% of the time. Weird.
NSScrollView.scrollPoint scrolls visibly, if view gets displayed as a result of a cursor key press, but not if view is displayed as result of a mouse click
 
 
Q