Search code examples
pythonobjectlistview

How to ask a ObjectListView which column is ordered and in which direction?


I want to ask a ObjectListView object if and which of its columns (index would be enough) are sorted and in which direction (asc or desc).

I know ObjectListView.GetSortColumn() which return a ColumnDef object.

But I can not see a way how to ask about the index of the ColumnDef.

In wx.ListCtrl I can not found anything about sorting.


Solution

  • There is no real getter.

    Use ObjectListView.sortColumnIndex for that. It will be '-1' if none of the columns are used for sorting.

    btw: How can I add code here? The "code snipped" symbol just come up with a ugly un-understandable dialog.