Hi there,
I'm having a problem using a 'wxTreeCtrl' in my project. More
specifically, I have to associate some data to every tree item, and be
able to retrieve this data (like "what's the data associated with the
selected item?")
With wxLua, I itended to create a table mapping 'wxTreeItemId's to the
data, something like:
T = { }
local id = tree:AppendItem ("Foo")
T[id] = "this is my very important data"
For my surprise, 'wxTreeItemId's seem to be "variable". If I select
the same tree item many times, I get a different 'wxTreeItemId' every
time.
I also tried to add a dummy 'wxTreeItemData' to every item, and use it
to index a table, like above. But, again, the 'wxTreeItemData' seems
to not be preserved...
In C++, I used to create a class derived from 'wxTreeItemData' and use
'wxTreeCtrl::SetItemData()', but I'd like very much to avoid using C++
for this. So, is there a "pure Lua" solution for this?
Thank you,
LMB