CocoaDev

Edit AllPages

How can I prevent an NSBrowser from both scrolling and changing the cell selection after reloading columns?


I haven’t looked into it, but can’t you retrieve the scroll position/selections and place them in variables? That way, after you reload it, just reset the scroll position and selection to the appropriate values. – RyanBates


wouldn’t that cause an extra re-draw? I recall when I was having difficulty getting the browser to NOT change selection after I reloaded columns, it turned out that I was working with the browser improperly. Instead of reloading, I should have been redrawing. I forget the exact method to use, but it turned out to be a fairly easy fix once I realized that I was re-loading much too often.


Actually I did something like this in my code to restore the cell selections and scroll positions. Something like the following (I have not included the supporting functions like absoultePathOfRepositoryRoot, etc…):

Then the restore is something like: