Is this what you want ...
import wx
class TestPanel(wx.Frame):
def __init__(self, parent, id):
wx.Frame.__init__(self, parent, -1,
'wx.BoxSizer test', size = (800, 400))
#win = wx.Window (self, -1)
box = wx.BoxSizer(wx.VERTICAL)
panel1 = wx.Panel(self)
panel1.SetBackgroundColour("green")
# 1=stretch allowed, and use 10 pixel border
box.Add(panel1, 1, wx.ALL|wx.EXPAND, 10)
panel2 = wx.Panel(self)
panel2.SetBackgroundColour("Red")
box.Add(panel2, 1, wx.ALL|wx.EXPAND, 10)
self.SetSizer(box)
# show the frame
self.Show(True)
app = wx.PySimpleApp()
tp = TestPanel(None, -1)
app.MainLoop()
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417