Hi all, I’m having some trouble changing the colour of some tabs, was wondering if you could help.
So I’m using a sub-class of AuiNotebook
, within it’s __init__
I’ve created a notebook:
wx.Aui.AuiNotebook.__init__(self, frame, id)
Got the handle of its art controller:
self._art = self.GetArtProvider()
and used that to set the colour of tabs from a dict defined earlier (cs
):
self._art.SetColour(wx.Colour(cs['tab_face']))
self._art.SetActiveColour(wx.Colour(cs['tab_face']))
And it seems to have no effect - the tabs are still their default colour. I’ve also tried getting the ActiveTabCtrl
and this just sets the colour of the tab backboard, not the tabs themselves:
self._tabCtrl = self.GetActiveTabCtrl()
self._tabCtrl.SetBackgroundColour(cs['note_bg']) # Sets colour on area behind tab
self._tabCtrl.SetForegroundColour(cs['tab_face'])
Am I doing this wrong, is there some other way to set tab colours that I’m not getting? Any help would be much appreciated!
UPDATE:
If I use SetArtProvider
to use an AuiSimpleTabArt
rather than AuiDefaultTabArt
then it does change the colour, but I want AuiDefault
style tabs just with the colour changed…