.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2025 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.persist.persist_handlers

.. highlight:: python



.. _wx.lib.agw.persist.persist_handlers.ToggleButtonHandler:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.persist.persist_handlers.ToggleButtonHandler**
==========================================================================================================================================

Supports saving/restoring a :class:`ToggleButton` and friends state.

This class handles the following wxPython widgets:

- :class:`ToggleButton`;
- :class:`lib.buttons.GenToggleButton`;
- :class:`lib.buttons.GenBitmapToggleButton`;
- :class:`lib.buttons.GenBitmapTextToggleButton`;
- :class:`lib.agw.shapedbutton.SToggleButton`;
- :class:`lib.agw.shapedbutton.SBitmapToggleButton`;
- :class:`lib.agw.shapedbutton.SBitmapTextToggleButton`.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div class="collabsible-wrapper">
      <input id="collapsible-inheritance" class="collapsible-checkbox" type="checkbox">
      <label for="collapsible-inheritance" tabindex="0" title="Show inheritance diagram" class="collapsible-label">Inheritance diagram for class <strong>ToggleButtonHandler</strong>:</label>
      <div class="collapsible-content">
         <p class="graphviz">
            <center><img src="_static/images/inheritance/wx.lib.agw.persist.persist_handlers.ToggleButtonHandler_inheritance.svg" alt="Inheritance diagram of ToggleButtonHandler" usemap="#dummy" class="inheritance invert-in-dark-mode"/></center>
            <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.persist.persist_handlers.ToggleButtonHandler.html" title="Supports saving/restoring a ToggleButton and friends state." alt="" coords="5,82,436,111"/> <area shape="rect" id="node2" href="wx.lib.agw.persist.persist_handlers.AbstractHandler.html" title="Base class for persistent windows, uses the window name as persistent name by" alt="" coords="23,5,418,34"/> </map> 
         </p>
      </div>
   </div>
   <script type="text/javascript" src="_static/inheritancetoggle.js"></script>



|


|super_classes| Known Superclasses
==================================

:class:`wx.lib.agw.persist.persist_handlers.AbstractHandler`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.agw.persist.persist_handlers.ToggleButtonHandler.__init__`        Default class constructor.
:meth:`~wx.lib.agw.persist.persist_handlers.ToggleButtonHandler.GetKind`         Returns a short and meaningful *string* description of your widget.
:meth:`~wx.lib.agw.persist.persist_handlers.ToggleButtonHandler.Restore`         Restores the widget's settings by calling :meth:`PersistentObject.RestoreValue() <lib.agw.persist.persistencemanager.PersistentObject.RestoreValue>`, which in
:meth:`~wx.lib.agw.persist.persist_handlers.ToggleButtonHandler.Save`            Saves the widget's settings by calling :meth:`PersistentObject.SaveValue() <lib.agw.persist.persistencemanager.PersistentObject.SaveValue>`, which in
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: ToggleButtonHandler(AbstractHandler)

   Supports saving/restoring a :class:`ToggleButton` and friends state.
   
   This class handles the following wxPython widgets:
   
   - :class:`ToggleButton`;
   - :class:`lib.buttons.GenToggleButton`;
   - :class:`lib.buttons.GenBitmapToggleButton`;
   - :class:`lib.buttons.GenBitmapTextToggleButton`;
   - :class:`lib.agw.shapedbutton.SToggleButton`;
   - :class:`lib.agw.shapedbutton.SBitmapToggleButton`;
   - :class:`lib.agw.shapedbutton.SBitmapTextToggleButton`.

   .. method:: __init__(self, pObject)

      Default class constructor.
      
      :param `pObject`: a :class:`~wx.lib.agw.persist.persistencemanager.PersistentObject` containing information about the
       persistent widget.


   .. method:: GetKind(self)

      Returns a short and meaningful *string* description of your widget.
      
      .. note:: This method must be overridden in derived classes.


   .. method:: Restore(self)

      Restores the widget's settings by calling :meth:`PersistentObject.RestoreValue() <lib.agw.persist.persistencemanager.PersistentObject.RestoreValue>`, which in
      turns calls :meth:`PersistenceManager.RestoreValue() <lib.agw.persist.persistencemanager.PersistenceManager.RestoreValue>`.
      
      .. note:: This method must be overridden in derived classes.


   .. method:: Save(self)

      Saves the widget's settings by calling :meth:`PersistentObject.SaveValue() <lib.agw.persist.persistencemanager.PersistentObject.SaveValue>`, which in
      turns calls :meth:`PersistenceManager.SaveValue() <lib.agw.persist.persistencemanager.PersistenceManager.SaveValue>`.
      
      .. note:: This method must be overridden in derived classes.


