You need to do two things. First you need to tell the scrolled window to what the scroll rate is, then it will show the scrollbars as exepcted when the virtual size is greater than the client size. Something like this:
def create_panel_from_xrc(self):
example = xrcexample(self)
sw = wx.xrc.XRCCTRL(example, "scrolled_window")
sw.SetScrollRate(20,20)
return example
Next you need to tell the panel's sizer to expand the scrolled window to fill the panel, so add this into the XRC for that sizer item:
<option>1</option>
<flag>wxEXPAND</flag>
BTW, a wx.ScrolledWindow is a wx.Panel, so there is no real reason to use the panel simply to hold your scrolled window. You could instead make it be the top parent in that XRC and then add it directly to the AUI pane.
···
On 7/20/12 5:16 AM, Frans Schneider wrote:
I try to load panels created with XRCed in a AUI frame. The panels are
sometimes larger than the pane and need scrollbars, so I enclosed the
content inside a scrolled window. The panel is created but I can not get
the scrollbars working. With the scroled window encloed within a sizer,
I was expecting this to work as stated in the documentation. I use the
XRCed generated Python code to load the panel. I am using wxPython
version 2.8.12.1 on Windows 7, XRCed version 0.2.0-8 and Python 2.7.
--
Robin Dunn
Software Craftsman