Closed cognociente closed 9 years ago
It's because you want the column header and row header to remain fixed at the top and left of the main content area while the main content area scrolls vertically or horizontally. But you still want the content of the column and row headers to scroll along with the main content scroll area. They won't get out of sync because as you scroll the main content area, the contentViewDidScroll notification will tell the column and row scrollers to match the scrolling of the main content area.
I achieved the same thing by manipulating layout constraints on my row/column headers as the main content scrolled. That was one of the things that worked quite nicely.
The side effect of you are doing it is that you can scroll the headers independently of the main content view (which doesn't make sense to me in this context as they are then out-of-sync).
Yes, that's true I see. If you would like to submit a pull request to change that, that would be great.
By the way, this specific implementation detail is left over from the original author and wasn't something I added myself.
Fixed. Also fixed a wacky scrolling behavior where the header and footer could be scrolled vertically (comment out the -adjustScroll: methods then use a trackpad to scroll vertically in the header to see it).
:+1:
Oops. Just noticed the footer view also scrolls independently and needs to be synchronized too.
I've just added scroll syncing for the footer too. Though there are other issues with the footer, as per #39. (But this issue can be closed.)
:+1:
Busy reading through the code and I see that there are NSScrollViews in the TableGrid for:
1) Surely this runs the risk of these different scrollViews going out of sync? 2) That doesn't seem to be in line with NSTableView which is all wrapped in a single NSScrollView.