Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import wx
- Beige = (255,255,160) #RGB
- class MainWindow(wx.Frame):
- """Doc string."""
- def __init__(self, parent, ID, title):
- wx.Frame.__init__(self, parent, ID, title, size=(600,400))
- UpperPanel = wx.Panel(self,-1, style=wx.RAISED_BORDER)
- LowerPanel = wx.Panel(self,-1, style=wx.SUNKEN_BORDER)
- UpperPanel.SetBackgroundColour(Beige)
- LowerPanel.SetBackgroundColour("GREEN")
- Textbox = wx.BoxSizer(wx.HORIZONTAL)
- Textbox.Add(LowerPanel)
- Scrollbox = wx.ScrolledWindow(LowerPanel)
- basicText = wx.StaticText(Scrollbox, -1, "Hello World",
- style=wx.ST_NO_AUTORESIZE)
- #self.SetSizer(Textbox) #Hides upper, crashes on exit
- Box = wx.BoxSizer(wx.VERTICAL)
- Box.Add(UpperPanel, 4, wx.EXPAND)
- Box.Add(Textbox, 1)
- self.SetSizer(Box)
- #Either commenting IN SetSizer(Textbox)
- #or commenting OUT SetSizer(Box)
- #will both make the beige part disappear!
- app = wx.App(False)
- frame = MainWindow(None, wx.ID_ANY, "Lobster Artifacts")
- frame.Show() #could go in MainWindow.init
- app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement