wxPython - SetLabel() function in wx.StaticText Last Updated : 17 Dec, 2021 Comments Improve Suggest changes Like Article Like Report 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) Parameters: Parameter Input Type Description label string The label to set. 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.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 ="Old Label.", pos =(0, 0), size = wx.DefaultSize, style = 0, name ="statictext") # NEW LABEL self.st.SetLabel("New Label.") 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 - SetLabel() function in wx.StaticText R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Python wxPython-StaticText Practice Tags : python Similar Reads 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 - 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 - IsVertical() function in wx.StaticLine In this article we are going to learn about IsVertical() method associated with wx.StaticLine class of wxPython. IsVertical() function is a simple function used in order to return True if the line is vertical, False if horizontal. Syntax: wx.StaticLine.IsVertical(self) Parameters No parameters are r 1 min read wxPython - Wrap() function in wx.StaticText() 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 word 1 min read wxPython - SetBackgroundColour() function in wx.StaticText In this article we are going to learn about SetBackgroundColour() function associated with wx.StaticText class of wxPython. SetBackgroundColour() function is simply used to set background of a static text to a different colour. It takes wx.Colour argument to set the background colour. Syntax: wx.Sta 1 min read Like