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") vbox = wx.BoxSizer(wx.VERTICAL) hbox1 = wx.BoxSizer(wx.HORIZONTAL) hbox2 = wx.BoxSizer(wx.HORIZONTAL) vbox.Add(hbox1, 0, wx.EXPAND) vbox.Add(hbox2, 0, wx.EXPAND) hbox1.Add(self.text1, 1) hbox1.Add(self.button1, 2) hbox2.Add(self.text2, 1) hbox2.Add(self.button2, 2) self.SetSizer(vbox) 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()