import wx
class Minimal(wx.App):
def OnInit(self):
main_window = wx.Frame(None, -1, "")
self.SetTopWindow(main_window)
main_window.Show()
return 1
if __name__ == "__main__":
app = Minimal(0)
app.MainLoop()
As with the panel, parent widgets to the window containing them. In this case, the new panel.
self.btn = wx.Button(self.panel, -1, "My Button!")
self.btn.Bind(wx.EVT_BUTTON, self.OnQuit)
Sizers control the placement of widgets, allowing them to grow and shrink depending on font sizes, languages, and window sizes.