wx.lib.stattext.GenStaticText¶
GenStaticText is a generic implementation of wx.StaticText.
Class Hierarchy¶
Known Subclasses¶
wx.lib.agw.infobar.AutoWrapStaticText
Known Superclasses¶
Methods Summary¶
Default class constructor. |
|
Can this window be given focus by mouse click? |
|
Disables the control. |
|
Overridden base class virtual. Determines the best size of |
|
Enable or disable the widget for user input. |
|
Overridden base class virtual. By default we should use |
|
Handles the |
|
Handles the |
|
Sets the static text font and updates the control’s size to exactly |
|
Sets the static text label and updates the control’s size to exactly |
|
Overridden base class virtual. If the parent has non-default |
Class API¶
- class GenStaticText(wx.Control)¶
GenStaticTextis a generic implementation ofwx.StaticText.
Methods¶
- __init__(self, parent, ID=-1, label='', pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name='genstattext')¶
Default class constructor.
- Parameters:
parent (
wx.Window) – parent window, must not beNone;ID (integer) – window identifier. A value of -1 indicates a default value;
label (string) – the static text label (i.e., its text label);
pos (tuple or
wx.Point) – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;size (tuple or
wx.Size) – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;style (integer) – the underlying
wx.Controlstyle;name (string) – the widget name.
- AcceptsFocus(self)¶
Can this window be given focus by mouse click?
Note
Overridden from
wx.Control.
- Disable(self)¶
Disables the control.
- Returns:
Trueif the window has been disabled,Falseif it had been already disabled before the call to this function.
Note
This is functionally equivalent of calling
Enablewith aFalseflag.Note
Overridden from
wx.Control.
- DoGetBestSize(self)¶
Overridden base class virtual. Determines the best size of the control based on the label size and the current font.
Note
Overridden from
wx.Control.
- Enable(self, enable=True)¶
Enable or disable the widget for user input.
- Parameters:
enable (bool) – If
True, enables the window for input. IfFalse, disables the window.- Returns:
Trueif the window has been enabled or disabled,Falseif nothing was done, i.e. if the window had already been in the specified state.
Note
Note that when a parent window is disabled, all of its children are disabled as well and they are re-enabled again when the parent is.
Note
Overridden from
wx.Control.
- GetDefaultAttributes(self)¶
Overridden base class virtual. By default we should use the same font/colour attributes as the native
wx.StaticText.Note
Overridden from
wx.Control.
- OnEraseBackground(self, event)¶
Handles the
wx.EVT_ERASE_BACKGROUNDevent forGenStaticText.- Parameters:
event – a
wx.EraseEventevent to be processed.
Note
This is intentionally empty to reduce flicker.
- OnPaint(self, event)¶
Handles the
wx.EVT_PAINTforGenStaticText.- Parameters:
event – a
wx.PaintEventevent to be processed.
- SetFont(self, font)¶
Sets the static text font and updates the control’s size to exactly fit the label unless the control has
wx.ST_NO_AUTORESIZEflag.- Parameters:
font (wx.Font) – a valid font instance, which will be the new font used to display the text.
- SetLabel(self, label)¶
Sets the static text label and updates the control’s size to exactly fit the label unless the control has
wx.ST_NO_AUTORESIZEflag.- Parameters:
label (string) – the static text label (i.e., its text label).
- ShouldInheritColours(self)¶
Overridden base class virtual. If the parent has non-default colours then we want this control to inherit them.
Note
Overridden from
wx.Control.