Sorting a ListCtrl

Mike Driscoll mdriscoll at co.marshall.ia.us
Tue Oct 2 07:43:43 PDT 2007


Robert, 

> -----Original Message-----
> From: Robert Dailey [mailto:rcdailey at gmail.com] 
> Sent: Monday, October 01, 2007 3:35 PM
> To: wxPython
> Subject: Sorting a ListCtrl
> 
> Hi,
> 
> Is there an example python script demonstrating how to sort 
> rows in a list control? Suppose I have a list control with 4 
> columns and I want each to be sortable descending / 
> ascending. From the documentation I've read this seems to be 
> a fairly complex procedure. Example code would probably get 
> me on my way. 
> 
> Thanks.
> 
> 

The wxPython Demo shows how to do exactly what you're looking for. They
basically subclass the ColumnSorterMixin and it does the work for you.
Just download the demo and check out the ListCtrl demo source.

Mike





More information about the wxpython-users mailing list