[wxPython-users] [wxGlade] Simple TAB_TRAVERSAL question
Marc Lebrun
marclebrun at skynet.be
Wed Dec 26 14:54:39 PST 2007
Well, I think I'll do it by hand and stop using wxGlade !
Here's what I wrote and it works perfectly :
class MainWindow(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, parent=None, title="Test", size=(600,500))
self.createWidgets()
self.createSizers()
def createWidgets(self):
self.mainPanel = wx.Panel(self)
self.textCtrl = wx.TextCtrl(self.mainPanel)
self.btnPanel = wx.Panel(self.mainPanel)
self.button = wx.Button(self.btnPanel, label='hello')
self.grid = wx.grid.Grid(self.mainPanel)
self.grid.CreateGrid(3, 3)
def createSizers(self):
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.textCtrl, 0, wx.EXPAND)
sizer.Add(self.btnPanel, 0, wx.EXPAND)
sizer.Add(self.grid, 1, wx.EXPAND)
self.mainPanel.SetSizer(sizer)
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.button, 0)
self.btnPanel.SetSizer(sizer)
I hope wxGlade author(s) will read this :-)
Marc.
More information about the wxpython-users
mailing list