wxPython Static Box Last Updated : 08 Jul, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we are going to learn about Static Box in wxPython. A static box is a rectangle drawn around other windows to denote a logical grouping of items. Note that while the previous versions required that windows appearing inside a static box be created as its siblings (i.e. use the same parent as the static box itself), since wxWidgets 2.9.1 it is also possible to create them as children of wx.StaticBox itself and you are actually encouraged to do it like this if compatibility with the previous versions is not important. Syntax: wx.StaticBox.StaticBox((parent, id=ID_ANY, label="", pos=DefaultPosition, size=DefaultSize, style=0, name=StaticBoxNameStr) Parameters Parameter Input Type Description parent wx.Window Parent window. Must not be None. id wx.WindowID Window identifier. The value wx.ID_ANY indicates a default value. label string Text to be displayed in the static box, the empty string for no label. pos wx.Point Window position. If wx.DefaultPosition is specified then a default position is chosen. size wx.Size Checkbox size. If wx.DefaultSize is specified then a default size is chosen. style long Window style. There are no StaticBox-specific styles, but generic ALIGN_LEFT, ALIGN_CENTRE_HORIZONTAL and ALIGN_RIGHT can be used here to change the position of the static box label when using wxGTK name string Window name Code Example: Python3 1== 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)) # 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() Output Window: Comment More infoAdvertise with us Next Article wxPython - Set tooltip for Button R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Python wxPython-StaticBox Practice Tags : python Similar Reads 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 Python - Statusbar in wxPython In this article we are going to learn how can we add a status bar to wxPython frame. We can create status bar in frame using CreateStatusBar() function present in wx.Frame class. By default it has white background and dark gray text color. Syntax: wx.Frame.CreateStatusBar(self, number=1, style=STB_D 1 min read wxPython - Set tooltip for Button In this article we will learn how we can assign a tooltip to a Button. In order to assign tooltip we use SetToolTip() function associated with wx.Button class of wxPython. SetToolTip() function takes a string argument that would be used as a tooltip. Syntax: wx.Button.SetToolTip(self, string) Parame 1 min read wxPython - Enable() method in wx.StaticBox In this article we are going to learn about Enable() method associated with wx.StaticBox class of wxPython. Enable() function is simply used in order to enable or disable the box without affecting its label window, if any. It takes a boolean 'enable' parameter if True enables the window else disable 1 min read wxPython - Show hidden Radio Box In this article we will learn how can we show the hidden Radio Box present in the frame. In order to do that we will use Show() method. Show() method can be used for both hide as well as show a widget. Show takes a boolean argument show, which if True shows the widget else hides it. Syntax: wx.Radio 2 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 Like