wxPython - ListCtrl ColumnSorterMixin sometimes works sometimesdoesn't!

S

Steve Senior

Hi,

My application has a tree control in which a user can select a filter.
This filter is then applied to the results and the results are
constructed in the ListControl (report style) widget.

This all works fine.

Recently I added the wx.lib.mixins.listctrl.ColumnSorterMixin mixin to
the ListCtrl widget.

Now here is the problem. On some of the filters you can sort all of the
columns both ascending and descending - i.e. if you click a column once
it will sort properly, then if you click the column again it will
happily reverse the sort.

On some of the filters you can only sort the column once. Repeated
clicks do not reverse the sort order. I added some print statments to
the listctrl.py to see what was happening here and it appears that when
you click the column for the second time, it actually sorts it twice
which means that the display doesn't change!

This is really perplexing me, I've exhausted all of my options and need
some help please.

Many Thanks,
Steve.
 
K

kyosohma

Hi,

My application has a tree control in which a user can select a filter.
This filter is then applied to the results and the results are
constructed in the ListControl (report style) widget.

This all works fine.

Recently I added the wx.lib.mixins.listctrl.ColumnSorterMixin mixin to
the ListCtrl widget.

Now here is the problem. On some of the filters you can sort all of the
columns both ascending and descending - i.e. if you click a column once
it will sort properly, then if you click the column again it will
happily reverse the sort.

On some of the filters you can only sort the column once. Repeated
clicks do not reverse the sort order. I added some print statments to
the listctrl.py to see what was happening here and it appears that when
you click the column for the second time, it actually sorts it twice
which means that the display doesn't change!

This is really perplexing me, I've exhausted all of my options and need
some help please.

Many Thanks,
Steve.

It sounds a lot like your program is firing an event twice. What event
are you using to capture the mouse-click? You are much better off
posting wxPython specific questions to the wxPython user's list:
http://www.wxpython.org/maillist.php

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top