Greetings all,
I have a wxPython project (created with wxFormBuilder) that contains two panels, each of which contain a wxListCtrl. When loading the list control, each can have different columns displayed. Since the lists are contained in the panels, they both have the same ID, and the same routine is for both the list’s populate routines.
I need to determine at runtime which list is being populated so that I can retrieve the appropriate configuration data. If I use the list.GetID() am I guaranteed that these values will be the same every time it is run? That is, can I safely save the config details based on the GetID() value so the next time it is run it does the right/same thing?
Is there a better, smarter, simpler way that eludes me?
Thanks!
I don’t think there’s any guarantee that GetID() will be consistent run to run.
Can you just assign your own ID to each list after it’s made? Something like:
Another idea is that if the child IDs aren’t unique, maybe you could use GetParent() and build a tuple of both the parent and list IDs, and then this tuple would be unique.
And even if the assigned IDs aren’t unique, the Python IDs will be.