import wx class MainFrame(wx.Frame): def __init__(self, parent): super(MainFrame, self).__init__(parent) self.text1 = wx.TextCtrl(self) self.text2 = wx.TextCtrl(self) self.button1 = wx.Button(self, label="Egyik") self.button2 = wx.Button(self, label="Másik") self.button3 = wx.Button(self, label="Harmadik") vbox1 = wx.BoxSizer(wx.VERTICAL) hbox1 = wx.BoxSizer(wx.HORIZONTAL) hbox2 = wx.BoxSizer(wx.HORIZONTAL) vbox1.Add(hbox1) vbox1.Add(hbox2) vbox1.Add(self.button3) hbox1.Add(self.text1) hbox1.Add(self.button1) hbox2.Add(self.text2) hbox2.Add(self.button2) self.SetSizer(vbox1) self.Layout() def OnClickButton(self, event): self.text.SetValue("42") class ButtonApp(wx.App): def OnInit(self): frame = MainFrame(None) frame.Show() return True app = ButtonApp() app.MainLoop()