]> git.saurik.com Git - wxWidgets.git/blame - wxPython/tests/scroll_paint.py
compilation error fix (trailing comma in an enum)
[wxWidgets.git] / wxPython / tests / scroll_paint.py
CommitLineData
8bf5d46e
RD
1from wxPython.wx import *
2
3class MyWindow(wxScrolledWindow):
4 def __init__(self,parent,id,pos,size,style):
5 wxScrolledWindow.__init__(self,parent,id,pos,size,style)
6 self.SetBackgroundColour(wxWHITE)
7
8 def OnPaint(self,evt):
9 dc = wxPaintDC(self)
10 # normally call a redraw/draw function here.
11 # this time, print 'redraw!'
12 print "redraw!"
13
14
15class MyFrame(wxFrame):
16 def __init__(self, parent, id, title):
17 wxFrame.__init__(self, parent, id, title,
18 wxPoint(100, 100), wxSize(500, 300))
19
20 self.sw = MyWindow(self, -1,
21 wxDefaultPosition, wxDefaultSize,
22 wxVSCROLL|wxSUNKEN_BORDER)
23
24 self.sw.SetScrollbars(1,20,0,30)
25
26
27if __name__ == "__main__":
28 class MyApp(wxApp):
29 def OnInit(self):
30
31 self.frame = MyFrame(NULL, -1, "Scrolling Test App")
32 self.frame.Show(true)
33 self.exiting = FALSE;
34 return true
35
36 app = MyApp(0) # Create an instance of the app class
37 app.MainLoop() # Tell it to start processing events
38