Scrolling question

I’ve stuck a scrollbar in one my components, but I’m a little lost on how to make the scrollbar actually work.

The component listens to the child scrollbar, and scrollBarMoved() is called
when the scroll bar is moved. My guess is that I then iterate over my child objects and move them in the opposite direction. Is there anything more clever than that?

Is there a standard way to show the scroll bar in a disabled state when the scrolled component becomes large enough to not need a scrollbar?

(It’s much easier to use a Viewport…)

And when you don’t want the scrollbar to be active, why not just make it invisible? That’s what most UIs do.

the ViewPort class was exactly what I was looking for. I didn’t see one in the Demo project, which is why I had to ask. If there’s not one there, that might be an instructive thing to add.

thanks for the pointer!