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?
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?