wxPython - Staticline using Create() function Last Updated : 28 Feb, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we are going to learn about Create() method associated with wx.StaticLine class of wxPython. A static line is just a line which may be used in a dialog to separate the groups of controls. Create() function creates Staticline using two step creation. The line may be only vertical or horizontal. Moreover, not all ports (notably not wxGTK) support specifying the transversal direction of the line (e.g. height for a horizontal line) so for maximal portability you should specify it as DefaultCoord. Syntax: wx.StaticLine.Create(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=LI_HORIZONTAL, name=StaticLineNameStr) Parameters ParameterInput TypeDescriptionparentwx.WindowParent window. Must not be None.idwx.WindowIDWindow identifier. The value wx.ID_ANY indicates a default value.poswx.PointWindow position. If wx.DefaultPosition is specified then a default position is chosen.sizewx.SizeSize. Note that either the height or the width (depending on whether the line is horizontal or vertical) is ignored.stylelongWindow style (either wx.LI_HORIZONTAL or wx.LI_VERTICAL).namestringWindow Name 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 hlist = ['Item One', 'Item Two'] vlist =['Item One', 'Item Two'] # initialize a static line self.sl = wx.StaticLine() # add attributes using Create() function self.sl.Create(pnl, 2, pos =(50, 0), size = (1, 250), style = wx.LI_VERTICAL) # 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 - Staticline using Create() function R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Python wxPython-StaticLine Practice Tags : python Similar Reads wxPython - Create() function in wx.StaticText In this article we are going to learn about Create() associated with wx.StaticText class of wxPython. A static text control displays one or more lines of read-only text. Create() function is used for two step creation of static text. It takes attributes of statictext as arguments. Syntax: wx.StaticT 1 min read Python - Create() function in wxPython In this particular article we are going to learn about Create() function present in wx.Frame class. Create function is similar to Frame() constructor of wx.Frame class. Create function is used in two-step frame construction. Syntax : wx.Frame.Create(parent, id=ID_ANY, title="", pos=DefaultPosition, 1 min read wxPython - Create() function in wx.StatusBar In this article, we are going to learn about Create() function associated with wx.StatusBar class of wxPython. Similar to StatusBar() constructor Create is used to add attributes to the status bar provided status bar variable should be initialized using StatusBar() constructor without any parameters 1 min read wxPython - Create Static Box using Create() method 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. In this article we will create Static Box using two step creation, in order to do that we will use Create() method. Syntax: wx.StaticBox.C 2 min read wxPython - Create Radio Button using Create() function Create() function is used for the two-step construction of Radio Button in wxPython. Create() function takes different attributes of radio button as an argument Syntax:  wx.RadioButton.Create(parent, id=ID_ANY, label="", pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, nam 1 min read Like