import wx class MainFrame(wx.Frame): def __init__(self, parent): super().__init__(parent) self.initUI() self.initLayout() def initUI(self): self.panel1 = wx.Panel(self) self.textCtrl1 = wx.TextCtrl(self.panel1) self.button1 = wx.Button(self.panel1, label='Mehet') def initLayout(self): rootBox = wx.BoxSizer(wx.HORIZONTAL) rootBox.Add(self.textCtrl1) rootBox.Add(self.button1) self.panel1.SetSizer(rootBox) class SimpleApp(wx.App): def OnInit(self): frame = MainFrame(None) frame.Show() return True app = SimpleApp() app.MainLoop()