Can I have ListCtrl accept a dictionary with non-integer keys?

Ok. I will have to do it that way then.
Thx

···

2006/11/14, Robin Dunn <robin@alldunn.com>:

TiNo wrote:
> I have information that I want to display in lists that is relatively
> linked by uuids. uuid's are strings. Is there a way (subclassing or
> overriding?) to have ListCtrl accept a dictionary with those uuids as
> keys?
>
> Error message I get when I try to do what I want (only copied relevant
> part):
>
> File "F:\Python\xmltodb\listctrl.py", line 36, in __init__
> self.PopulateList(values)
> File "F:\Python\xmltodb\listctrl.py", line 87, in PopulateList
> self.list.SetItemData(index, key)
> File "P:\Python24\lib\site-packages\wx-2.6-msw-ansi\wx\_controls.py",
> line 4669, in SetItemData
> return _controls_.ListCtrl_SetItemData(*args, **kwargs)
> TypeError: argument number 3: a 'number' is expected,
> 'str(9cabaf89-a0df-4242-98dd-ffbfbe126c40)' is received

No, currently the listctrl can only have integer data values associated
with the items. So you can workaround this by making a dictionary that
maps some unique integer values to your uuid values.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org