wxPython - Wrap() function in wx.StaticText() Last Updated : 18 Jun, 2020 Comments Improve Suggest changes Like Article Like Report In this article we are going to learn about Wrap() function associated with wx.StaticText class of wxPython. Wrap() functions wraps the controls label so that each of its lines becomes at most width pixels wide if possible (the lines are broken at words boundaries so it might not be the case if words are too long). If width is negative, no wrapping is done. Note that this width is not necessarily the total width of the control, since a few pixels for the border (depending on the controls border style) may be added. Syntax: wx.StaticText.Wrap(self, width) Parameters: Parameter Input Type Description width int width for wrapping. Code Example: Python3 1== import wx class Example(wx.Frame): def __init__(self, *args, **kwargs): super(Example, self).__init__(*args, **kwargs) self.InitUI() def InitUI(self): self.locale = wx.Locale(wx.LANGUAGE_ENGLISH) self.pnl = wx.Panel(self) bmp = wx.Bitmap('right.png') # CREATE STATICTEXT AT POINT (20, 20) self.st = wx.StaticText(self.pnl, id = 1, label ="Lorem ipsum ... laborum.", pos =(0, 0), size = wx.DefaultSize, style = 0, name ="statictext") # WRAP TEXT IN A PARTICULAR WIDTH self.st.Wrap(300) 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() Output Window: Comment More infoAdvertise with us Next Article wxPython - Wrap() function in wx.StaticText() R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Python wxPython-StaticText 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 wxPython - GetLabel() function in wx.StaticText In this article we are going to learn about GetLabel() function associated with wx.StaticText class of wxPython. GetLabel() function is an important function it is used to get the string label associated with wxPython. It returns a string. No parameters are required in GetLabel() function. Syntax: w 1 min read wxPython - SetLabel() function in wx.StaticText In this article we are going to learn about SetLabel() function associated with wx.StaticText class of wxPython. SetLabel() function is used to set the string label for the Static Text. It takes a string parameter that is used as label for Static Text. Syntax: wx.StaticText.SetLabel(self, label) Par 1 min read wxPython - IsEllipsized() function in wx.StaticText In this article we are going to learn about IsEllipsized() function associated with wx.StaticText class of wxPython. IsEllipsized() function is used to return True if the window styles for this control contains one of the ST_ELLIPSIZE_START, ST_ELLIPSIZE_MIDDLE or ST_ELLIPSIZE_END styles. Syntax: wx 1 min read wxPython - SetStatusText() function in wx.StatusBar In this article we are going to learn about SetStatusText() function associated with wx.StatuBar class of wxPython. SetStatusText() function is simply used to set the status text for the i-th field. The given text will replace the current text. The display of the status bar is updated immediately, s 1 min read Like