How to scroll a viewport


#1

I have a custom List (entirely custom, it doesn’t inherit from juce::ListBox // just in case it matters) inside a juce::Viewport. Somewhere in my app I have some buttons (Goto first item, Goto last item, Goto i-th item, etc). Everything works great so far, when for example I click Goto first item, it does focus the first item. But, I need to scroll the viewport when the item I focus using the button is out of sight. Is that even possible?


#2

void Viewport::setViewPosition()

and

bool ScrollBar::scrollToTop

Rail