1 from wxPython
.wx 
import * 
   3 class MyWindow(wxScrolledWindow
): 
   4     def __init__(self
,parent
,id,pos
,size
,style
): 
   5         wxScrolledWindow
.__init
__(self
,parent
,id,pos
,size
,style
) 
   6         self
.SetBackgroundColour(wxWHITE
) 
  10         # normally call a redraw/draw function here. 
  11         # this time, print 'redraw!' 
  15 class MyFrame(wxFrame
): 
  16     def __init__(self
, parent
, id, title
): 
  17         wxFrame
.__init
__(self
, parent
, id, title
, 
  18                          wxPoint(100, 100), wxSize(500, 300)) 
  20         self
.sw 
= MyWindow(self
, -1, 
  21                            wxDefaultPosition
, wxDefaultSize
, 
  22                            wxVSCROLL|wxSUNKEN_BORDER
) 
  24         self
.sw
.SetScrollbars(1,20,0,30) 
  27 if __name__ 
== "__main__": 
  31             self
.frame 
= MyFrame(NULL
, -1, "Scrolling Test App") 
  36     app 
= MyApp(0)     # Create an instance of the app class 
  37     app
.MainLoop()     # Tell it to start processing events