I think I got it. I added the below code to the end of the program (after removing what you said to remove) and I don’t see errors. It just feels complex at the beginning when you still feel confused about Frames, Panels, Windows, sizers, their relations and so on. Looking at different examples from the Web can make it more complex in your mind. Some examples don’t have much of def’s (functions) and classes as the most simple examples don’t need so much code.
class Frame(wx.Frame):
def __init__(self, parent, title, style, name):
super(Frame, self).__init__(parent, title=title, style=style, name=name)
self.InitUI()
self.Centre()
def InitUI(self):
panel = TestLayoutConstraints(self)
def main():
app = wx.App(redirect=False, filename=None, useBestVisual=False, clearSigInt=True)
frame = Frame(None, title="LayoutConstraints", style=wx.DEFAULT_FRAME_STYLE, name="LayoutConstraints")
frame.Show()
app.MainLoop()
if __name__ == '__main__':
main()