It seems like you are trying to use the SetChildIndex method on a MyPanel object, but this method does not exist in the wx.Panel class.

The SetChildIndex method is only available in classes that inherit from wx.Window and wx.SizerItem.

To fix this error, you should either remove the call to SetChildIndex or make sure that your MyPanel class inherits from wx.Window or wx.SizerItem.

wxPanel AttributeError MyPanel object has no attribute SetChildIndex