I’ve been trying to get a checked sorted list working for some time and since my knowledge of WXPython is still rudimentary I saw an example of this on one of the threads. I’ve incorporated it into my program but I can’t quite get it to work properly. I want to select from one list and display a checked sorted list in another panel. This solution attached almost works but I need some way to clear the previous table because if I choose another selection, although this appears to go to table two, if I try to select it or use the horizontal slider, it gets mixed up.
If you can run the attached program, hit the Run button, select Light_Red from the first table and the second table gets populated. If you then select Light_Green for example from the first table, it all starts to go horribly wrong. If you move the horizontal slider it all starts to disappear.
I’ve been looking at this for days and can’t work out what I need to do some if anyone can spell out what I need to do I’d be very grateful.
I've been trying to get a checked sorted list working for some time and since my knowledge of WXPython is still rudimentary I saw an example of this on one of the threads. I've incorporated it into my program but I can't quite get it to work properly. I want to select from one list and display a checked sorted list in another panel. This solution attached almost works but I need some way to clear the previous table because if I choose another selection, although this appears to go to table two, if I try to select it or use the horizontal slider, it gets mixed up.
If you can run the attached program, hit the Run button, select Light_Red from the first table and the second table gets populated. If you then select Light_Green for example from the first table, it all starts to go horribly wrong. If you move the horizontal slider it all starts to disappear.
I've been looking at this for days and can't work out what I need to do some if anyone can spell out what I need to do I'd be very grateful.
You are creating a new SortedCheckList every time the item in the first listctrl is selected. So the problems you are seeing stem from the fact that there are multiple widgets stacked on top of each other, and at least some of the events are being handled by the ones that are not visible. (This is typical on Windows with overlapping siblings.) You need to do one of the following:
* Destroy() the old widget when creating the new one. This is not recommended however because there will be some visible artifacts of the transition, such as flicker.
* Only create one SortedCheckList at the beginning of the application and just change its contents when items in the first listctrl are selected.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!