Advertisement
Guest User

wxpython dummy code

a guest
Feb 5th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.17 KB | None | 0 0
  1. import wx
  2.  
  3. Beige = (255,255,160) #RGB
  4.  
  5. class MainWindow(wx.Frame):
  6.     """Doc string."""
  7.     def __init__(self, parent, ID, title):
  8.         wx.Frame.__init__(self, parent, ID, title, size=(600,400))
  9.  
  10.         UpperPanel = wx.Panel(self,-1, style=wx.RAISED_BORDER)
  11.         LowerPanel = wx.Panel(self,-1, style=wx.SUNKEN_BORDER)
  12.        
  13.         UpperPanel.SetBackgroundColour(Beige)
  14.         LowerPanel.SetBackgroundColour("GREEN")
  15.  
  16.         Textbox = wx.BoxSizer(wx.HORIZONTAL)
  17.         Textbox.Add(LowerPanel)
  18.        
  19.         Scrollbox = wx.ScrolledWindow(LowerPanel)
  20.         basicText = wx.StaticText(Scrollbox, -1, "Hello World",
  21.                                   style=wx.ST_NO_AUTORESIZE)
  22.         #self.SetSizer(Textbox) #Hides upper, crashes on exit
  23.  
  24.         Box = wx.BoxSizer(wx.VERTICAL)
  25.         Box.Add(UpperPanel, 4, wx.EXPAND)
  26.         Box.Add(Textbox, 1)
  27.         self.SetSizer(Box)
  28.         #Either commenting IN SetSizer(Textbox)
  29.         #or commenting OUT SetSizer(Box)
  30.         #will both make the beige part disappear!
  31.  
  32. app = wx.App(False)
  33. frame = MainWindow(None, wx.ID_ANY, "Lobster Artifacts")
  34. frame.Show() #could go in MainWindow.init
  35. app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement