.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2018 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.BitmapToggleButton: ========================================================================================================================================== |phoenix_title| **wx.BitmapToggleButton** ========================================================================================================================================== :ref:`wx.BitmapToggleButton` is a :ref:`wx.ToggleButton` that contains a bitmap instead of text. This class is not available in all ports currently (although it is available in the major ones), test for ``HAS_BITMAPTOGGLEBUTTON`` to determine whether it can be used (in addition for possibly testing for ``USE_TOGGLEBTN`` which can be set to 0 to explicitly disable support for this class and :ref:`wx.ToggleButton`). This control emits an update UI event. .. _BitmapToggleButton-events: |events| Events Emitted by this Class ===================================== Handlers bound for the following event types will receive a :ref:`wx.CommandEvent` parameter. - EVT_TOGGLEBUTTON: Handles a wxEVT_TOGGLEBUTTON event. | |class_hierarchy| Class Hierarchy ================================= .. raw:: html <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;"> <img id="toggleBlock-trigger" src="_static/images/closed.png"/> Inheritance diagram for class <strong>BitmapToggleButton</strong>: </div> <div id="toggleBlock-summary" style="display:block;"></div> <div id="toggleBlock-content" style="display:none;"> <p class="graphviz"> <center><img src="_static/images/inheritance/wx.BitmapToggleButton_inheritance.png" alt="Inheritance diagram of BitmapToggleButton" usemap="#dummy" class="inheritance"/></center> <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script> <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.BitmapToggleButton.html" title="wx.BitmapToggleButton is a wx.ToggleButton that contains a bitmap instead of text." alt="" coords="19,469,202,499"/> <area shape="rect" id="node2" href="wx.ToggleButton.html" title="wx.ToggleButton is a button that stays pressed when clicked by the user." alt="" coords="43,392,178,421"/> <area shape="rect" id="node3" href="wx.AnyButton.html" title="A class for common button functionality used as the base for the various button classes." alt="" coords="53,315,168,344"/> <area shape="rect" id="node4" href="wx.Control.html" title="This is the base class for a control or 'widget'." alt="" coords="64,237,157,267"/> <area shape="rect" id="node5" href="wx.Window.html" title="wx.Window is the base class for all windows and represents any visible object on screen." alt="" coords="62,160,159,189"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="A class that can handle events from the windowing system." alt="" coords="51,83,170,112"/> <area shape="rect" id="node7" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="5,5,93,35"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="Add-on base class for a trackable object." alt="" coords="118,5,229,35"/> </map> </p> </div> | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.BitmapToggleButton.__init__` Default constructor. :meth:`~wx.BitmapToggleButton.Create` Create method for two-step construction. :meth:`~wx.BitmapToggleButton.GetClassDefaultAttributes` :meth:`~wx.BitmapToggleButton.GetValue` Gets the state of the toggle button. :meth:`~wx.BitmapToggleButton.SetValue` Sets the toggle button to the given state. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.BitmapToggleButton.Value` See :meth:`~wx.BitmapToggleButton.GetValue` and :meth:`~wx.BitmapToggleButton.SetValue` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.BitmapToggleButton(ToggleButton) **Possible constructors**:: BitmapToggleButton() BitmapToggleButton(parent, id=ID_ANY, label=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, val=DefaultValidator, name=CheckBoxNameStr) BitmapToggleButton is a ToggleButton that contains a bitmap instead of text. .. method:: __init__(self, *args, **kw) |overload| Overloaded Implementations: :html:`<hr class="overloadsep" /><br />` **__init__** `(self)` Default constructor. :html:`<hr class="overloadsep" /><br />` **__init__** `(self, parent, id=ID_ANY, label=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, val=DefaultValidator, name=CheckBoxNameStr)` Constructor, creating and showing a toggle button with the bitmap `label`. Internally calls :meth:`Create` . :param `parent`: :type `parent`: wx.Window :param `id`: :type `id`: wx.WindowID :param `label`: :type `label`: wx.Bitmap :param `pos`: :type `pos`: wx.Point :param `size`: :type `size`: wx.Size :param `style`: :type `style`: long :param `val`: :type `val`: wx.Validator :param `name`: :type `name`: string :html:`<hr class="overloadsep" /><br />` .. method:: Create(self, parent, id=ID_ANY, label=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, val=DefaultValidator, name=CheckBoxNameStr) Create method for two-step construction. :param `parent`: :type `parent`: wx.Window :param `id`: :type `id`: wx.WindowID :param `label`: :type `label`: wx.Bitmap :param `pos`: :type `pos`: wx.Point :param `size`: :type `size`: wx.Size :param `style`: :type `style`: long :param `val`: :type `val`: wx.Validator :param `name`: :type `name`: string :rtype: `bool` .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) :param `variant`: :type `variant`: wx.WindowVariant :rtype: :ref:`wx.VisualAttributes` .. method:: GetValue(self) Gets the state of the toggle button. :rtype: `bool` :returns: Returns ``True`` if it is pressed, ``False`` otherwise. .. method:: SetValue(self, state) Sets the toggle button to the given state. This does not cause a ``EVT_TOGGLEBUTTON`` event to be emitted. :param `state`: If ``True``, the button is pressed. :type `state`: bool .. attribute:: Value See :meth:`~wx.BitmapToggleButton.GetValue` and :meth:`~wx.BitmapToggleButton.SetValue`