Open In App

wxPython – SetBackgroundColour() function in wx.StatusBar

Improve
Improve
Like Article
Like
Save
Share
Report

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:

Parameter Input Type Description
colour wx.Colour Colour 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:


Last Updated : 15 Jun, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads