*************** wx.ToggleButton *************** Inheritance diagram for `wx.ToggleButton`: | .. inheritance-diagram:: wx.ToggleButton | Description =========== `wx.ToggleButton` is a button that stays pressed when clicked by the user. In other words, it is similar to `wx.CheckBox `_ in functionality but looks like a `wx.Button `_. .. seealso:: `wx.CheckBox `_, `wx.Button `_ Derived From ^^^^^^^^^^^^^ * `wx.Control `_ * `wx.Window `_ * `wx.EvtHandler `_ * `wx.Object `_ Event Handling ^^^^^^^^^^^^^^ ================================================== ================================================== Event Name Description ================================================== ================================================== wx.EVT_TOGGLEBUTTON(id, func) Handles a toggle button click event. ================================================== ================================================== | Control Appearance ^^^^^^^^^^^^^^^^^^ | .. figure:: ../images/wxWidgets/wxmsw/togglebutton.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: ../images/wxWidgets/wxmac/togglebutton.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: ../images/wxWidgets/wxgtk/togglebutton.png :alt: wxGTK :figclass: floatcenter **wxGTK** | Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `GetValue <#GetValue>`_ * `SetValue <#SetValue>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Value <#Value>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(parent, id=-1, label="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, validator=wx.DefaultValidator, name=wx.ToggleButtonNameStr) Constructor, creating and showing a toggle button. **Parameters:** * `parent` (`wx.Window `_) * `id` (int) * `label` (string) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `validator` (`wx.Validator `_) * `name` (string) | **Returns:** `wx.ToggleButton `_ -------- .. method:: GetValue() Gets the state of the toggle button. Returns ``True`` if it is pressed, ``False`` otherwise. | **Returns:** `bool` -------- .. method:: SetValue(value) Sets the toggle button to the given state. This does not cause a ``wx.EVT_TOGGLEBUTTON`` event to be emitted. **Parameters:** * `value` (bool): If ``True``, the button is pressed -------- Properties ^^^^^^^^^^ .. attribute:: Value See `GetValue <#GetValue>`_ and `SetValue <#SetValue>`_