wxPython - GetClassDefaultAttributes() function in wx.Button Last Updated : 27 Feb, 2023 Comments Improve Suggest changes Like Article Like Report 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 arguments. Syntax: wx.Button.GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)Parameters: ParameterInput TypeDescriptionvariantWindowVariantVariant for button. Return Type: wx.VisualAttributes 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.pnl = wx.Panel(self) self.btn = wx.Button(self.pnl, label ='Button', pos =(20, 20)) # wx.VisualAttributes OBJECT va = self.btn.GetClassDefaultAttributes(variant = wx.WINDOW_VARIANT_NORMAL) # PRINT PROPERTIES print(va.colBg) print(va.colFg) print(va.font) self.SetSize((350, 250)) self.SetTitle('wx.Button') self.Centre() def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Console Output: (240, 240, 240, 255) (0, 0, 0, 255) Output Window: Comment More infoAdvertise with us Next Article wxPython - GetClassDefaultAttributes() function in wx.Button R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Python wxPython-Button Practice Tags : python Similar Reads 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 | 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.StatusBar 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. 1 min read wxPython - GetDefaultSize() function in wx.Button In this article we are going to learn about GetDefaultSize() function associated with wx.Button class of wxPython. GetDefaultSize() function is used to return the default size for the buttons. It is advised to make all the dialog buttons of the same size and this function allows retrieving the (plat 1 min read wxPython - GetLabel() function in wx.Button In this article, we are going to learn about GetLabel() function associated with wx.Button class of wxPython. GetLabel() function is used to return the string label for the button. No parameters are required by GetLabel() function. Syntax: wx.Button.GetLabel(self) Parameters: No parameters are requi 1 min read Like