I have a set of buttons that I created, and you need to change the color of the button when pressed. It currently sets the default colors (gray = inactive, light blue = active):

but I want to change the color of the active to red.
Here is my button class:
class ButtonClass(wx.Panel): def __init__(self, parent, name, id): wx.Panel.__init__(self, parent) self.name = name self.taskid = id self.button = wx.ToggleButton(self, 1, size=(50, 50)) self.button.SetLabel('Start') self.mainSizer = wx.BoxSizer(wx.HORIZONTAL) self.mainSizer.Add(self.button) self.Bind(wx.EVT_TOGGLEBUTTON, self.toggledbutton, self.button)
I tried using self.button.SetColour , self.button.SetBackgroundColour , self.button.SetForegroundColour , all of which were not successful. Is there a way to do this in wxpython?
source share