That's normal inside a wxScrolledWindow.apoorv569 wrote: ↑Wed Sep 22, 2021 9:53 amOh! This is nice, this does fix the problem somewhat. I noticed that when I expand the window size, more stuff appears, but once I get expand it to the point that the scrollbar disappears, and then I make the window small again, I don't get the scroll bar backdoublemax wrote: Check out wxWrapSizer: https://docs.wxwidgets.org/trunk/classw ... sizer.html
You need to catch the size event and force the virtual width to be the client width.
Code: Select all
scrolled_window->Bind(wxEVT_SIZE, [this](wxSizeEvent& event) {
SetVirtualSize( wxSize( GetClientSize().x, -1 ) );
});