Want header object from wx.ListCtrl

I want to wx.HeaderCtrl object including wx.Listctrl and Bind wx.HD_ALLOW_REORDER event.

I want a notification when the user rearranges the columns order.
In order to save the columns order and reflect it at the next startup.

further, I want to disable systemtheme and customize appearance of header.

Is there a way to achieve these?

environment: windows10,wxPython4.1,Python3.7

I’m not sure I fully inderstand your question, but it seems you want to be able to access somewx.HeaderCtrl functionality from wx.ListCtrl, correct?

If so, it’s not possible. The wx.HeaderCtrl is only used in the non-native versions of wx.ListCtrl and so accessing it is not part of the public wx.ListCtrl API. Are you able to get what you need from the EVT_LIST_COL_* events?

Thanks for advice.

I want a notification when the user sorts(reorder) column using drag and drop.
However, I can’t find the corresponding event in wx.ListCtrl.

From a accessibility perspective, I have a strong commitment to being native controls.

You may want to switch to a DataViewCtrl or a DataViewListCtrl. The EVT_DATAVIEW_COLUMN_REORDERED should give you what you need.

Thank you for your suggestions.

I tried wx.dataview.DataViewListCtrl.
But this Control was made with listbox instead of listview in windows.

We are visual impairments and using the application with a screen reader.
Therefore, it is essential that the content of the control matches the native object type.

wx.dataview.DataViewListCtrl likes listviewCtrl. But made from listboxCtrl.
My screen reader read only first row. Possibly, it may be forcibly drawn Except the first row.

I know that, we can customize reading(ex:wx.Accessable).
But It is not good. It cause lot of trouble and makes hard to use.

wx.ListCtrl is Faithful to native controls. That is most important for us.
So we use that. We can’t help but deal with this topic in a less recommended way

Yes, the data view controls on Windows are not native widgets.

So there isn’t a way currently to be notified of columns being reordered. It’s probably doable, but would require changes in wxWidgets to support it. In the meantime, you could periodically poll with the GetColumnsOrder method to check if the order has changed since the last time you checked, and then react to the change at that point.

Thanks for advice.
I was able to do it use GetColumnsOrder() several times.
I hope update wxWidgets and support it.