wxpython sorting multiple listctrls

27 views Asked by At

I'm having trouble sorting multiple listctrls in wxpython. I can sort one but not another. I assume it all circles around the ColumnSorterMixin requirement for a function called GetListCtrl. That function can only return one listctrl otherwise and index error will occur as it will only sort the last returned listctrl. Is there a way around this? Many thanks!

1

There are 1 answers

0
RobinDunn On

It sounds like you are using the ColumSorterMixin when creating the class that is a parent of the listctrls, like in the demo, and putting multiple listctrls on the parent. If you instead use it as one of the base classes when deriving a new ListCtrl class then GetListCtrl can just return self, and each listctrl will then have its own sorter.