I wanted to customize the color of the hint window. I retrieved the art provider and called ap.SetColour ( aui.AUI_DOCKART_HINT_WINDOW_COLOUR, wx.Colour( r, g, b ) )
When I show the hint however, I noticed no color change. So I traced the events down through and set a breakpoint where the color gets set to the default. This happens every time I drag a frame from being docked to floating.
return core.PyApp_MainLoop(*args, **kwargs)
/usr/lib64/python2.7/site-packages/wx-3.0-gtk3/wx/lib/agw/aui/framemanager.py(9305)OnSysColourChanged()
→ self._art.Init()
/usr/lib64/python2.7/site-packages/wx-3.0-gtk3/wx/lib/agw/aui/dockart.py(187)Init()
→ self.SetDefaultColours()
/usr/lib64/python2.7/site-packages/wx-3.0-gtk3/wx/lib/agw/aui/dockart.py(233)SetDefaultColours()
My color is now overridden with the default again.
I’m not why OnSysColourChanged is getting fired since I certainly didn’t change any colors while I was in the processing of dragging my dock window. Even if the event is legit shouldn’t the dock art provider retain it’s settings rather than init to default? (Otherwise what’s the point of The SetXXX functions?)
So…
For now I created my own class that extends the default provider and returns my color for the hint window and otherwise is still the default. Worth noting I set a number of other metrics, icons etc and they all don’t get overridden. Seems the color part is a bug to me.
wx.version()
···
3.0.2.0 gtk3 (classic)