esitarski / CrossMgr

Cyclo Cross Management Application
MIT License
41 stars 20 forks source link

Fix bug where trigger list appears in reverse order #113

Closed kimble4 closed 1 year ago

kimble4 commented 1 year ago

Fix for #112

It appears that repeatedly inserting items in wx.ListCtrl at the same index gives an undefined order? I'm seeing the list in descending order under Windows, but not Linux.

Style wx.LC_SORT_ASCENDING is set, but it appears this has no effect unless a callback is set.

Using GetItemCount() for the insert index corrects this behaviour, as the triggers are always inserted at a different index.

esitarski commented 1 year ago

There must have been a change in wxPython. There were 5 more instances of where InsertItem was called with 99999 in CrossMgr, and I changed them all to use GetItemCount.

kimble4 commented 1 year ago

I'm getting reverse order again today. Must be more to it than that...

esitarski commented 1 year ago

Removed LC_SORT_ASCENDING flag as recommended by this.