Hello all,
I'm perpetual wxPython novice with a question about
documentation (wxPython-2.8.12.0).
I am trying to write a ListBox subclass that will handle
data associated with each item by automatically calling
.GetClientData() and .SetClientData() or equivalent as
needed.
So my first question is, is there anything like this
already out there? Assuming no, then...
In one of my methods, I call:
self.Insert (s, pos, data)
where 'self' is my ListBox subclass. This results in
the error:
TypeError: 'Insert() takes exactly 3 arguments (4 given)'
The wxWigets doc does not list the Insert() method in ListBox
but gives three signatures in ListBox's superclass, wxControlWithItems:
int Insert(const wxString& item, unsigned int pos)
int Insert(const wxString& item, unsigned int pos, void *clientData)
int Insert(const wxString& item, unsigned int pos, wxClientData *clientData)
From the error I got, I guess only the first signature is
implemented?
If I look in wxPython's _core.py, in the ItemContainer section
(apparently the superclass of wxControlWithItems), I see:
Insert(self, String item, int pos, PyObject clientData=None) -> int
The wxPython API docs for ListBox at
http://www.wxpython.org/docs/api/wx.ListBox-class.html
say it has an Insert although it doesn't mention a return value:
Insert(self, item, pos, clientData)
Insert an item into the control before the item at the pos index,
optionally associating some data object with the item.
And the API doc for ItemContainer at
http://www.wxpython.org/docs/api/wx.ItemContainer-class.html
gives the same interface but specifies a return value:
int Insert(self, item, pos, clientData)
Insert an item into the control before the item at the pos index,
optionally associating some data object with the item.
I thought maybe the ListBox doc includes inherited methods but
there are some ItemContainer methods like IsEmpty that aren't
mentioned in the ListBox API. There seems to be some confusing
and conflicting information here.
So, the question...
How the heck am I supposed to find out what the *real*
ListBox.Insert() signature is?? (I'm assuming this is not a
one-off case in the docs -- an answer to the general problem
would be nice.) Thanks for any enlightenment.