I can’t seem to find a way to detect if a TreeView has been scrolled. The only thing I can see is to attach a ScrollBar::Listener, but this only detects direct user manipulation of the ScrollBar, which isn’t enough.
To save on boring words, here’s a quick image of my layout:
i.e. a TreeView and a TableListBox married together, with the vertical scrollbar disabled on the TreeView.
I can keep the TreeView in sync with the TableListBox easily enough (albeit awkwardly, via TableListBoxModel::listWasScrolled). However, if the user scrolls* through the TreeView itself, I can’t see anything to respond to.
I know that Viewport has a virtual interface to respond to its changes (which is what I’m really interested in), but the problem here is that these components provide their own Viewport, so I cannot override them.
I can see two solutions, really:
- Add a Viewport::Listener class
- Add callbacks to these components to respond to viewport changes
[size=85]*There’s also the fact that the user can’t actually mouse-scroll the TreeView when the scrollbar is disabled (except with the cursor keys), which I’d like to find a solution for, but I’m not too worried about that right now.