I am trying to subclass the wxpython SingleChoiceDialog class. I have a TableChoiceDialog class that inherits from SingleChoiceDialog, adding universal functionality, and I have 2 subclasses for which more advanced functionality has been added. Mostly I'm OOP'ing
In my TableChoiceDialog class, I have a row that calls the __init__ superclass, 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 am facing is that according to SingleChoiceDialog.__init__ docstring (and wxPython API) SingleChoiceDialog does not have a self argument as part of this __init__ method.
__init__(Window parent, String message, String caption, List choices=EmptyList, long style=CHOICEDLG_STYLE, Point pos=DefaultPosition) -> SingleChoiceDialog
As I said above, the program prints an error:
swig/python detected a memory leak of type 'wxSingleChoiceDialog *', no destructor found.
If I select the self parameter, the system complains that it expected the SingleChoiceDialog object SingleChoiceDialog be the first argument, which seems to indicate that it really wants a reference to itself.
When I take out the parent argument, leaving self (and the other 3, which I'm sure everything is fine), the system complains that it only got 3 arguments when it needs 4. I'm pretty sure I'm passing 4.
So. What obvious mistake have I made? I did not completely understand how python handles objects (and, therefore, rather misunderstood python)? Am I misunderstood OOP in general?
Please, help. thanks in advance