************* wx.StaticText ************* Inheritance diagram for `wx.StaticText`: | .. inheritance-diagram:: wx.StaticText | Description =========== A static text control displays one or more lines of read-only text. .. seealso:: `wx.StaticBitmap `_, `wx.StaticBox `_ Derived From ^^^^^^^^^^^^^ * `wx.Control `_ * `wx.Window `_ * `wx.EvtHandler `_ * `wx.Object `_ Window Styles ^^^^^^^^^^^^^ ================================================== ================================================== Window Style Description ================================================== ================================================== ``wx.ALIGN_LEFT`` Align the text to the left ``wx.ALIGN_RIGHT`` Align the text to the right ``wx.ALIGN_CENTRE`` Center the text (horizontally) ``wx.ST_NO_AUTORESIZE`` By default, the control will adjust its size to exactly fit to the size of the text when `SetLabel <#SetLabel>`_ is called. If this style flag is given, the control will not change its size (this style is especially useful with controls which also have ``wx.ALIGN_RIGHT`` or ``wx.ALIGN_CENTER`` style because otherwise they won't make sense any longer after a call to `SetLabel`) ================================================== ================================================== | Control Appearance ^^^^^^^^^^^^^^^^^^ | .. figure:: ../images/wxWidgets/wxmsw/statictext.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: ../images/wxWidgets/wxmac/statictext.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: ../images/wxWidgets/wxgtk/statictext.png :alt: wxGTK :figclass: floatcenter **wxGTK** | Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `GetLabel <#GetLabel>`_ * `SetLabel <#SetLabel>`_ * `Wrap <#Wrap>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(parent, id=-1, label="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name=wx.StaticTextNameStr) Constructor, creating and showing a static text control. **Parameters:** * `parent` (`wx.Window `_) * `id` (int) * `label` (string) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `name` (string) | **Returns:** `wx.StaticText `_ -------- .. method:: GetLabel() Returns the contents of the control. **Returns:** `string` -------- .. method:: SetLabel(label) Sets the static text label and updates the controls size to exactly fit the label unless the control has ``wx.ST_NO_AUTORESIZE`` flag. **Parameters:** * `label` (string): The new label to set. It may contain newline characters. -------- .. method:: Wrap(width) This 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. This function is new since wxWidgets version 2.6.2 **Parameters:** * `width` (int)