Skip to content
Related Articles

Related Articles

wxPython – SetBackgroundColour() function in wx.StatusBar

View Discussion
Improve Article
Save Article
  • Last Updated : 15 Jun, 2020
View Discussion
Improve Article
Save Article

In this article e are going to learn about SetBackgroundColour() function associated with wx.StatusBar class of wxPython. SetBackgroundColour() function is used to set the colour of the background of the status bar. It takes wx.Colour as an argument.

Syntax: wx.StatusBar.SetBackgroundColour(self, colour)

Parameters:

ParameterInput TypeDescription
colourwx.ColourColour for the background.

Code Example:




import wx
  
  
class Example(wx.Frame):
  
    def __init__(self, *args, **kwargs):
        super(Example, self).__init__(*args, **kwargs)
  
        self.InitUI()
  
    def InitUI(self):
  
        self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
        self.statusbar = wx.StatusBar(self, id = 1
              style = wx.STB_DEFAULT_STYLE, name ="sb")
        self.statusbar.SetStatusText("This is StatusBar")
        self.statusbar.SetBackgroundColour((80, 60, 170, 230))
  
        self.SetStatusBar(self.statusbar)
  
def main():
    app = wx.App()
    ex = Example(None)
    ex.Show()
    app.MainLoop()
  
  
if __name__ == '__main__':
    main()

Output Window:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!