]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-08/scroll_window.py
   3 class ScrollbarFrame(wx
.Frame
): 
   5         wx
.Frame
.__init
__(self
, None, -1, 'Scrollbar Example',  
   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
) 
  14     def OnClickTop(self
, event
): 
  15         self
.scroll
.Scroll(600, 400) 
  17     def OnClickBottom(self
, event
): 
  18         self
.scroll
.Scroll(1, 1) 
  20 if __name__ 
== '__main__': 
  21     app 
= wx
.PySimpleApp() 
  22     frame 
= ScrollbarFrame()