I’m trying to scroll a component using a ViewPort, but I’m having trouble with the horizontal scroll bar. Instead of appearing and disappearing as the viewport’s bounds change, it’s never being drawn.
mScrollingPane->setBounds(0,0,100,340) mViewPort = new Viewport(T("Scroller")); mViewPort->setViewedComponent(mScrollingPane); mViewPort->setScrollBarsShown(false,true); mViewPort->setBounds(0,0,100,360); addAndMakeVisible(mViewPort);
In debugging, I can see that my scrolling pane gets wider than the Viewport, at which point the horizontal scroll bar should appear. The horizontal scroll bar’s visible flag is set to true. The scroll bar paint() routine is never called, but the UpdateThumbPosition() is called when the ViewPort is resized.
Is there something here I missed? Some assumption about the connection between the Viewport and the ViewedComponent that I’m not setting properly?