I am developing a GUI using wxPython. I draw a square that represents a CD object inside another square (also with the wxPanel class) that represents a CD container object. I want to βremove this CDβ in the CDWindow right-click menu, which will remove CDWindow. Basically, my code looks like this (for simplicity, I keep the main parts):
class CDContainerWindow(wx.Panel):
def __init__(self):
wx.Panel.__init__(self, parent, id, pos, size)
cd_win=CDWindow()
class CDWindow(wx.Panel):
def __init__(self):
wx.Panel.__init__(self, parent, id, pos, size)
self.Bind(wx.EVT_MENU, self.OnDeleteCD, item_CD)
def OnDeleteCD(self, event):
self.destroy()
I receive a "Segmentation Error" error message, What is wrong with my path? How to remove this CD window from the CDContainer window?
source
share