wxPython | Get default attributes of Radio Box Last Updated : 14 Mar, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we are going to learn about GetClassDefaultAttributes() function associated with wx.RadioBox class of wxPython. GetClassDefaultAttributes() function is used to return wx.VisualAttributes object for properties like background color, foreground color and font associated with Radio box. It takes variant as arguments. Syntax: wx.RadioBox.GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)Parameters: ParameterInput TypeDescriptionvariantWindowVariantVariant for Radio 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) # list of choices lblList = ['Radio One', 'Radio Two'] # create radio box containing above list self.rbox = wx.RadioBox(pnl, label ='RadioBox', pos =(80, 10), choices = lblList, majorDimension = 1, style = wx.RA_SPECIFY_COLS) # create wx.VisualAttributes object vb = self.rbox.GetClassDefaultAttributes() # print Background Colour print (vb.colBg) # print Foreground Colour print (vb.colFg) # print Background Colour print (vb.font) # 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) <wx._gdi.Font; proxy of > Output Window: Comment More infoAdvertise with us Next Article wxPython - Disable Radio button R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Python wxPython-Button 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 wxPython - Get visual attributes of static box 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, f 1 min read wxPython - Change font of Radio Button In this article we are going to learn that how can we change the font of the label text present on the radio button present in the frame. We need to follow some steps as follows: Step 1: Create a wx.Font object. Step 2: Add different attributes of font in parameters like: family, style etc. Step 3: 1 min read wxPython - Disable Radio button In this article we are going to learn about how can we disable a radio button present in a frame. Sometimes when we dont want user to press a button we can disable a button and the button become unclickable. In order to disable a button we can use Disable() function associated with wx.RadioButton cl 1 min read wxPython - Change Size of Radio Button In this article we will learn to change size of a Radio Button. We will change the size of Radio Button using SetSize() function associated with wx.RadioButton class of wxPython. SetSize() function is simply used to change the size of the window of Radio Button in pixels. Syntax: wx.RadioButton.SetS 1 min read wxPython - Hide Radio Button In this article we are going to learn about that, how can we hide a radio button present on frame. We can hide a radio button using Hide() function. Hide() function takes no argument and hide the radio button window from the frame. Hide() is different from Drop() as it just hides the radio button an 1 min read Like