Hi All,
I am a bit confused and do not know how to go about doing this..
When I add a new item to a wx.Choice or wx.ComboBox I can use
SetClientData() and it accepts an arbitrary python object reference
like;
""" Tabs need to be added to the list """
# if the tab is the first to be added, select it and fill edit
idx = self.__mTabSelect.Append(message.data.getName())
self.__mTabSelect.SetClientData(idx, message.data)
message.data is a Song() object. So that's cool. But when I try to use
SetItemData from the wx.ListCtrl, it expects an int:
self.__mLinks.SetItemData(index, l)
File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_controls.py", line
4561, in SetItemData
return _controls_.ListCtrl_SetItemData(*args, **kwargs)
AttributeError: Link instance has no attribute '__int__'
With the code:
self.__mLinks.SetItemData(index, l)
Where l is a Link() object. I am confused becuase the same code seems
to work for the wx.Choice.
How do I go about converting the object reference to attach the client
data to the list ctrl item? I would like to get a reference back when
doubleclicking on the object, so that I do not have to have lookup
tables, or use special integer ID's in my object's list..
Regards,
- Jorgen