]> git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-08/scroll_window.py
don't use invalid wxIconBundles, it results in asserts after recent changes
[wxWidgets.git] / wxPython / samples / wxPIA_book / Chapter-08 / scroll_window.py
1 import wx
2
3 class ScrollbarFrame(wx.Frame):
4 def __init__(self):
5 wx.Frame.__init__(self, None, -1, 'Scrollbar Example',
6 size=(300, 200))
7 self.scroll = wx.ScrolledWindow(self, -1)
8 self.scroll.SetScrollbars(1, 1, 600, 400)
9 self.button = wx.Button(self.scroll, -1, "Scroll Me", pos=(50, 20))
10 self.Bind(wx.EVT_BUTTON, self.OnClickTop, self.button)
11 self.button2 = wx.Button(self.scroll, -1, "Scroll Back", pos=(500, 350))
12 self.Bind(wx.EVT_BUTTON, self.OnClickBottom, self.button2)
13
14 def OnClickTop(self, event):
15 self.scroll.Scroll(600, 400)
16
17 def OnClickBottom(self, event):
18 self.scroll.Scroll(1, 1)
19
20 if __name__ == '__main__':
21 app = wx.PySimpleApp()
22 frame = ScrollbarFrame()
23 frame.Show()
24 app.MainLoop()
25
26