import wx class MainFrame(wx.Frame): def __init__(self, parent): super(MainFrame, self).__init__(parent) self.text1 = wx.TextCtrl(self) self.button1 = wx.Button(self, label="Egyik") vbox = wx.BoxSizer(wx.HORIZONTAL) vbox.Add(self.text1, 1) vbox.Add(self.button1, 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()