Hi,
I try to make 5 textctrls appear in a frame and I receive this error message which I don’t understand:
File "E:\Programmes\Eclipse\workspace\ExplorGrilSud\cel05.py", line 14, in __init__
wx.Panel.__init__(self, parent)
TypeError: Panel(): arguments did not match any overloaded call:
overload 1: too many arguments
overload 2: argument 1 has unexpected type 'sip.wrappertype'
Thank you very much for your help.
Here is my code:
import wx
import wx.lib.mixins.inspection
class MyFrame(wx.Frame):
def __init__(self, parent):
super().__init__(parent, title='Cellule')
self.panel = wx.Panel()
cell = Cell(MyFrame)
class Cell(wx.Panel):
def __init__(self, parent):
super().__init__(parent)
self.cell_pan = wx.Panel(self)
self.csg = wx.TextCtrl(self.cell_pan, size=(50, 25))
self.csd = wx.TextCtrl(self.cell_pan, size=(50, 25))
self.ctr = wx.TextCtrl(self.cell_pan, value = "6345", size=(100, 50))
self.cig = wx.TextCtrl(self.cell_pan, size=(50, 25))
self.cid = wx.TextCtrl(self.cell_pan, size=(50, 25))
celsz = wx.BoxSizer(wx.VERTICAL)
szhaut = wx.GridSizer(1, 2, 0, 0)
szhaut.Add(self.csg, 0)
szhaut.Add(self.csd, 0)
szbas = wx.GridSizer(1, 2, 0, 0)
szbas.Add(self.cig, 0)
szbas.Add(self.cid, 0)
celsz.Add(szhaut)
celsz.Add(self.ctr, 0)
celsz.Add(szbas)
self.cell_pan.SetSizer(celsz)
name = "r1c1"
if __name__ == '__main__':
app = wx.App()
frame = MyFrame(None)
frame.Show()
wx.lib.inspection.InspectionTool().Show()
app.MainLoop()