wxPython - Get visual attributes of static box Last Updated : 01 Sep, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we are going to learn how can we get wx.VisualAttributes associated with Static Box. In order to do that we will use static GetClassDefaultAttributes() function. GetClassDefaultAttributes() function is used to return wx.VisualAttributes object for properties like background colour, foreground colour and font. Syntax: wx.StaticBox.GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)Parameters ParameterInput TypeDescriptionvariantWindowVariantvariant associate with Static Box. Return Type: wx.VisualAttributes Code Example: Python3 import wx class FrameUI(wx.Frame): def __init__(self, parent, title): super(FrameUI, self).__init__(parent, title = title, size =(300, 200)) # function for in-frame components self.InitUI() def InitUI(self): # parent panel for radio box pnl = wx.Panel(self) # create static box self.sb = wx.StaticBox(pnl, 2, label ="Static Box", pos =(20, 20), size =(100, 100)) # wx.VisualAttributes object va = self.sb.GetClassDefaultAttributes(wx.WINDOW_VARIANT_NORMAL) # background and foreground colours print (va.colBg) print (va.colFg) # set frame in centre self.Centre() # set size of frame self.SetSize((400, 250)) # show output frame self.Show(True) # wx App instance ex = wx.App() # Example instance FrameUI(None, 'RadioButton and RadioBox') ex.MainLoop() Console Output: (247, 247, 247, 255) (61, 61, 61, 255) Output Window: Comment More infoAdvertise with us Next Article wxPython - Get visual attributes of static box R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Python wxPython-StaticLine Python wxPython-StaticBox +1 More Practice Tags : python Similar Reads wxPython - Get Default Attributes of StaticText In this article, we are going to learn how can we get different attributes of StaticText like background, foreground colors, and fonts. We use GetClassDefaultAttributes() function to get an object of wx.VisualAttributes. It may or may not take variant as an argument. Syntax: wx.StaticText.GetClassDe 1 min read How to Get a List of Class Attributes in Python? Getting a list of class attributes in Python means identifying all variables defined at the class level, excluding instance attributes and methods. For example, a class might have attributes like name, age and location. The output will be a list or dictionary showing these attribute names and their 3 min read How to Get a List of Class Attributes in Python? Getting a list of class attributes in Python means identifying all variables defined at the class level, excluding instance attributes and methods. For example, a class might have attributes like name, age and location. The output will be a list or dictionary showing these attribute names and their 3 min read wxPython - GetClassDefaultAttributes() method in wx.StaticLine In this article we are going to learn about GetClassDefaultAttributes() function associated with wx.StaticLine class of wxPython. GetClassDefaultAttributes() function is used to return wx.VisualAttributes object for properties like background colour, foreground colour and font. Syntax: wx.StaticLIne 1 min read wxPython - Change Font of StaticText In this article we are going to learn how can we change the font of static text present on the window. To do this first of all, we will create a wx.Font class of wxPython. After this we will use SetFont() function of wx.StaticText class. SetFont() function takes a sing wx.Font type parameter. Syntax 1 min read Like