.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 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
Inheritance diagram for class BitmapToggleButton:
| |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:`

` **__init__** `(self)` Default constructor. :html:`

` **__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.BitmapBundle :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:`

` .. 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.BitmapBundle :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`