code_junkie

adding scrollbars to pythoncard application

Nov 13th, 2011
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. class Scrolled(wx.ScrolledWindow):
  2. def __init__(self, parent):
  3. wx.ScrolledWindow.__init__(self, parent, size=(200,200))
  4. self.SetScrollRate(0, 10);
  5. sizerV = wx.BoxSizer(wx.VERTICAL)
  6. #create a bunch of stuff in the sizer which doesnt fit
  7. for i in range(0,50):
  8. text = "Line: " + str(i)
  9. sizerV.Add(wx.StaticText(self, label=text), 0)
  10.  
  11. self.SetSizer(sizerV)
  12.  
  13. class Frame(wx.Frame):
  14. def __init__(self, parent):
  15. wx.Frame.__init__(self, parent, size=(200,200), Scrolled(self)
  16. title="Scroll Bars", style=wx.CAPTION)
Add Comment
Please, Sign In to add comment