I am unable to change the background color of column labels of wx.ListCtrl on Linux.
I have tried a solution base on SetHeaderAttr as suggested here: How to set the header attributes - wxPyWiki
But it is not working on my Linux system, the label background color remains unchanged (white).
This seems normal it is stated that it is implemented on Windows only.
I have also tried to capture directly the inner windows composing the widget using GetChildren().
It outputs two Window object.
The first one seems to be the rows of the ListCtrl, and applying a SetBackgroundColour() on it changes the background color of the rows properly.
The second one is probably the label, but applying SetBackgroundColour() on it have no effect.
The is no gran-children on this Window.
lc = wx.ListCtrl(self, -1, style=wx.LC_REPORT | wx.LC_SINGLE_SEL) # Apply SetHeaderAttr on ListCtrl object: not working font_bold = wx.Font(wx.FontInfo(10).Bold()) head_bac_colr = wx.Colour(grey') lc.SetHeaderAttr(wx.ItemAttr(wx.NullColour, head_bac_colr, font_bold)) # Trying to catch inner widget windows children = lc.GetChilren() children.SetBackgroundColour('grey') # applies background colors on rows. this is working properly children.SetBackgroundColour('grey') # should apply background colors on label. this is not working
I don’t really want to go for an Ultimatelistctrl as I want to keep the GUI consistent with other elements.
Some people have suggested that it may be possible to hack the ListCtrl to make it work, but I don’t know how to do that.
Any suggestions to how to handle the issue would be greatly appreciated.