def __init__(self, *args, **kwargs):
wx.Panel.__init__(self, *args, **kwargs)
## add two buttons:
theButton1 = wx.Button(self, label="Push Me")
theButton1.Bind(wx.EVT_BUTTON, self.onButton)
## add two buttons:
theButton2 = wx.Button(self, label="Push Me Also")
theButton2.Bind(wx.EVT_BUTTON, self.onButton)
## do the layout
## (try uncommenting the other, and see what happens...)
#S = wx.BoxSizer(wx.VERTICAL)
S = wx.BoxSizer(wx.HORIZONTAL)
S.Add(theButton1, 0, wx.GROW | wx.ALL, 4)
S.Add(theButton2, 0, wx.GROW | wx.ALL, 4)
self.SetSizerAndFit(S)
评论列表
文章目录