wxPython - GetClassDefaultAttributes() function in wx.StatusBar Last Updated : 02 Mar, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we are going to learn about GetClassDefaultAttributes() associated to the class wx.StatusBar of wxPython. GetClassDefaultAttributes() is used to return visual attributes of statusbar like background color, foreground color, the font used for control label/text inside it. Syntax : wx.ToolBar.GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) Return Type: wx.VisualAttributes Parameters : ParameterInput TypeDescriptionvariantwindowVariantVariant style of window Code Example: Python3 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.statusbar.Create(self, id = 1, style = wx.STB_DEFAULT_STYLE, name = "Status Bar") self.SetStatusBar(self.statusbar) self.SetSize((350, 250)) # Get wx.VisualAttributes object va = self.statusbar.GetClassDefaultAttributes(variant = wx.WINDOW_VARIANT_NORMAL) # Print Background Colour print(va.colBg) # Print Fore Ground Colour print(va.colFg) # Print Identifier for font family print(va.font.Family) self.SetTitle('New Frame Title') self.Centre() def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Output: (240, 240, 240, 255) (0, 0, 0, 255) 70 Output Window: Comment More infoAdvertise with us Next Article wxPython - GetStatusText() function in wx.StatusBar R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Practice Tags : python Similar Reads wxPython | GetClassDefaultAttributes() function in python In this article we are going to learn about GetClassDefaultAttributes() of class wx.ToolBar of wxPython. GetClassDefaultAttributes() is used to return visual attributes of toolbar like background color, foreground color, the font used for control label/text inside it. Parameters : ParameterInput Typ 1 min read wxPython - GetClassDefaultAttributes() function in wx.Button In this article we are going to learn about GetClassDefaultAttributes() function associated with wx.Button class of wxPython. GetClassDefaultAttributes() function is used to return wx.VisualAttributes object for properties like background colour, foreground colour and font.It takes variant as argume 1 min read wxPython - GetStatusText() function in wx.StatusBar In this article we are going to learn about GetStatusText() function associated with wx.StatusBar class of wxPython. GetStatusText() function is one of the most useful method in wx.StatusBar as this function returns the string associated with a status bar field. It only takes single argument the num 1 min read wxPython - GetClassDefaultAttributes() function in wx.BitmapButton In this article we are going to learn about GetClassDefaultAttributes() function associated with wx.BitmapButton class of wxPython. GetClassDefaultAttributes() function is used to return wx.VisualAttributes object for properties like background colour, foreground colour and font.It takes variant as 1 min read wxPython - GetBorders() function in wx.StatusBar In this article we are going to learn about GetBorders() function associated with wx.StatusBar class of wxPython. GetBorders() function returns the horizontal and vertical borders used when rendering the field text inside the field area. Note that the rect returned by GetFieldRect already accounts f 1 min read wxPython - GetStatusWidth() function in wx.StatusBar In this article we are going to learn about GetStatusWidth() function associated with the wx.StatusBar class of wxPython. GetStatusWidth() function is simply used to return the width of the n-th field. It only takes index(position) of field as argument. Syntax: wx.StatusBar.GetStatusWidth(self, n) P 1 min read Like