I currently have a wxPanel that I draw lines, text etc on to in response to paint events by using a device context from wx.PaintDC. However, my drawing can exceed the size of the panel and it continues off the visible screen. The only way to see more of the drawing is to expand the application window, which is impractical and still may not allow the full drawing to be seen in the case of very large drawings. Ideally, I want to be able to scroll the drawing so that the application window does not need to be resized and large drawings can be seen.
Looking around, it seems that I may want to use a wxScrolledPanel instead of a wxPanel. However, i've had no success with using this - would using a wxScrolledPanel only work when using controls (e.g. buttons, text fields) rather than painting on the device context?
What is the appropriate way to scroll a panel that has been drawn on?
It should work with a ScrolledPanel but if you are not going to have other widgets on the panel it is probably not the right answer since it depends on having a sizer to set the virtual size. 
Try using a wx.ScrolledWindow instead, and see its sample in the demo for some code.  Basically you just need to set the virtual size of the window and it will take care of the scrollbars and scrolling for you.  You will also need to call PrepareDC in your paint event handler so it will offset the drawing to match the scrolled viewport origin.
Scrolling a painted frame in wxPython