wxPython - How to add sorting to a ListCtrl?

Jason tenax.raccoon at gmail.com
Tue Jul 24 20:01:19 CEST 2007


On Jul 24, 10:21 am, Robert Dailey <rcdai... at gmail.com> wrote:
> Hi,
>
> I have 3 columns in my list control, each with a different "type" of
> data (for example, one column has names, the other has dates, etc).
> Can anyone reference a tutorial for solving this issue? I've done my
> share of googling to no avail. I need the user to be able to click any
> of the column headers and sort the rows of data by that column in
> ascending or descending order.
>
> Thanks for your time.

You probably want to post these questions to the wxPython forums.
Still, take a look at the wxPython demo [1].  Under the "Core Windows/
Controls" category, the ListCtrl demo does exactly what you describe.
They have code and comments built into the demo itself.

[1] http://www.wxpython.org/download.php

  --Jason




More information about the Python-list mailing list