after changing sorting column, column label is wrong aligned

Hello,

I’m using a sortable ListCtrl. After changing the sorting column, the label of the column isn’t left aligned anymore. Can anyone tell me why this happens and how i can prevent it?

Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32

wxPython 2.9.4.0 msw (classic)

Test_ColSort.py (10.1 KB)

Still having this problem. Does anyone have a solution for it?

Torsten wrote:

Hello,

I'm using a sortable ListCtrl. After changing the sorting column, the
label of the column isn't left aligned anymore. Can anyone tell me why
this happens and how i can prevent it?

This is probably a quirk (or "feature" from MS's perspective) of the native listctrl. Something similar happens with list items, if there is an image list then it assumes that all items will have an image and so it reserves space for it in the first column. It looks like it is assuming that if a column has had an image before then it always will, and it is reserving space for it. For the left-aligned columns it is more noticeable but it is happening on the others too.

The only workaround I can think of at the moment is to use another icon on the columns that are not sorted. Or to use a different list ctrl.

···

--
Robin Dunn
Software Craftsman