Why the textctrls don't appear?

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()

First, you need to pass an instance of a class for the parent parameter, not the class itself. So remove the first line, and change the second to:

        cell = Cell(self)

Second, you are not giving the Cell class any instructions for how to size and layout its self.cell_pan child. So it is being left at its very small default size, hiding the widgets on that sub panel. Adding code like this will take care of that.

        sizer = wx.BoxSizer()
        sizer.Add(self.cell_pan, 1, wx.EXPAND)
        self.SetSizer(sizer)

OTOH, there really isn’t a need to have that sub panel, so placing those widgets directly on the Cell panel would be an option as well.

Hi Mr Dunn,
It is now working thanks to your instructions which are greatly appreciated…