While doing a project i decided to do a mechanism in a panal of its own class, so i could manage the sizers and layout better, then i wanted to take the end result of that panel and display it in my window.
Although when i run this code as a tester, i get a very strange error message and it leaves me stumped, because its asking me for a size variable(w, h), which is vexing me to no end because im sure the sizers would have covered that.
import wx
class Panel1(wx.Panel):
def __init(self, parent, id):
wx.Panel.__init__(self, parent, wx.ID_ANY)
subPanel1 = wx.Panel(SelectionMechanism, style = wx.SUNKEN_BORDER)
sizer1 = wx.BoxSizer()
sizer1.Add(subPanel1, proportion = 1, flag = wx.EXPAND)
class Panel2(wx.Panel):
def __init(self, parent, id):
wx.Panel.__init__(self, parent, wx.ID_ANY)
subPanel2 = wx.Panel(SelectionMechanism, style = wx.SUNKEN_BORDER)
sizer2 = wx.BoxSizer()
sizer2.Add(subPanel2, proportion = 1, flag = wx.EXPAND)
class MyWindow(wx.Frame):
def __init__(self, parent, id):
wx.Frame.__init__(self, parent, id, 'Window', size = (500, 500))
sizer = wx.BoxSizer()
sizer.Add(Panel1, proportion = 1, flag = wx.EXPAND)
sizer.Add(panel2, proportion = 1, flag = wx.EXPAND)
MyWindow.SetSizer(sizer)
app = wx.App(redirect = False)
frame = MyWindow(parent = None, id = -1)
frame.Show()
app.MainLoop()
Can anyone help please? This code is exactly the same principle as my main project and throws the same error.