[wxpython-users] Beginners Question

Robin Dunn robin at alldunn.com
Mon Sep 1 13:50:30 PDT 2008


James Potter wrote:
> Hi,
> 
> Try using a PyScrolledWindow. It's the same as a panel but with 
> scrolling functionality built in. Make sure you call SetScrollRate() at 
> some point or it won't work.
> 
> http://wxpython.org/docs/api/wx.PyScrolledWindow-class.html
> 

No need to use a PyScrolledWindow unless you are going to be deriving a 
new class from it and need to override some of the C++ methods. 
Otherwise a plain wx.ScrolledWindow is good enough.

In addition to setting the scroll rate you also need to set the virtual 
size of the window.  When it is larger than the real size then the 
scrollbars will appear and will be functional.  The virtual size can be 
set by having items in a sizer, as shown in later messages, or you can 
simply call SetVirtualSize yourself if the content of the window does 
not use a sizer.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!



More information about the wxpython-users mailing list