Layout a wxSizer inside a wxScrolledWindow

Try using theWindow.Layout() instead. I think wxScrolledWindow adds some extra logic there. If that doesn't help then try theWindow.FitInside()

···

On 9/12/12 3:49 PM, Glen Takahashi wrote:

When I called some_sizer.Layout() inside a wxScrolledWindow, it doesn't
update correctly. The size now appears to be correct, but the location
on screen is not relative to the scroll position, only the absolute
position. So, if I am scrolled to the top and call layout, everything
will look normal, but if scroll down 300 pixels, when I call layout, it
will be positioned on the screen 300 pixels too high.

One workaround I have tried, is if I programatically scroll to the top,
run .Layout(), and then scroll back to where I was, but this is less
than optimal.

--
Robin Dunn
Software Craftsman

Ooooh. Thank you this works perfectly :slight_smile:

···

On Friday, September 14, 2012 12:56:44 AM UTC-7, Robin Dunn wrote:

On 9/12/12 3:49 PM, Glen Takahashi wrote:

When I called some_sizer.Layout() inside a wxScrolledWindow, it doesn’t

update correctly. The size now appears to be correct, but the location

on screen is not relative to the scroll position, only the absolute

position. So, if I am scrolled to the top and call layout, everything

will look normal, but if scroll down 300 pixels, when I call layout, it

will be positioned on the screen 300 pixels too high.

One workaround I have tried, is if I programatically scroll to the top,

run .Layout(), and then scroll back to where I was, but this is less

than optimal.

Try using theWindow.Layout() instead. I think wxScrolledWindow adds
some extra logic there. If that doesn’t help then try theWindow.FitInside()


Robin Dunn

Software Craftsman

http://wxPython.org