I have been trying for long to change the background colour of a wx.ToolBar, without sucess.
I am using wxPython 4.1.1 on Fedora Core 32, Plasma 5, Python 3.8.6.
Using this example taken from, here:
import wx
class Example(wx.Frame):
global count
count = 0;
def __init__(self, *args, **kwargs):
super(Example, self).__init__(*args, **kwargs)
self.InitUI()
def InitUI(self):
self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
pnl = wx.Panel(self)
self.toolbar = self.CreateToolBar()
# Add tools to toolbar
ptool = self.toolbar.AddTool(12, 'oneTool',
wx.Bitmap('right.png'),
wx.Bitmap('right.png'), shortHelp ="Simple Tool Right")
qtool = self.toolbar.AddTool(12, 'oneTool', wx.Bitmap('wrong.png'),
wx.Bitmap('wrong.png'), shortHelp ="Simple Tool Wrong")
# change background colour of toolbar
print(f"SetBkGnd result {self.toolbar.SetBackgroundColour((0, 0, 50))}")
self.toolbar.Realize()
self.SetSize((350, 250))
self.SetTitle('Control')
self.Centre()
def main():
app = wx.App()
ex = Example(None)
ex.Show()
app.MainLoop()
if __name__ == '__main__':
main()
I get the below result (I used copied images from the site):
Can some one help me to clarify if this is a broken behaviour on wx.ToolBar (SetBackgroundColour)?
Thanks.