I'm trying to subclass the wxpython SingleChoiceDialog class. I have a TableChoiceDialog class that inherits from SingleChoiceDialog adding generic functionality, and I have 2 sub classes for that add more refined functionality. Basically I'm O.O.P'ing
In my TableChoiceDialog class I have a line which calls the superclass's __init__
, i.e.
class TableChoiceDialog(wx.SingleChoiceDialog):
def __init__(self, parent, message, caption, list, ...other args...):
wx.SingleChoiceDialog.__init__(self, parent, message, caption, list)
The problem I'm having is that according to the SingleChoiceDialog.__init__
docstring (and the wxPython API), SingleChoiceDialog does not have the self argument as part of it's __init__
method.
__init__(Window parent, String message, String caption,
List choices=EmptyList, long style=CHOICEDLG_STYLE,
Point pos=DefaultPosition) -> SingleChoiceDialog
As I have it above, the program prints the error:
swig/python detected a memory leak of type 'wxSingleChoiceDialog *', no destructor found.
If I take out the self parameter the system complains that it was expecting a SingleChoiceDialog
object as a first argument, which seems to point to it actually wanting a reference to self.
When I take out the parent argument, leaving self (and the other 3 which I'm pretty sure are fine) the system complains that it only recieved 3 arguments, when it needed 4. I'm pretty certain I'm passing 4.
So. What blatantly obvious mistake have I made? Have I totally misunderstood how python handles objects (and hence pretty much misunderstood python)? Have I misunderstood OOP as a whole?
Please help. Thanks in advance