.. 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



.. _wx.ToolTip:

==========================================================================================================================================
|phoenix_title|  **wx.ToolTip**
==========================================================================================================================================

This class holds information about a tooltip associated with a window (see :meth:`wx.Window.SetToolTip` ). 
         

The four static methods, :meth:`wx.ToolTip.Enable` , :meth:`wx.ToolTip.SetDelay`   :meth:`wx.ToolTip.SetAutoPop`   and :meth:`wx.ToolTip.SetReshow`   can be used to globally alter tooltips behaviour. 









|

|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>ToolTip</strong>:</label>
      <div class="collapsible-content">
         <p class="graphviz">
            <center><img src="_static/images/inheritance/wx.ToolTip_inheritance.svg" alt="Inheritance diagram of ToolTip" usemap="#dummy" class="inheritance invert-in-dark-mode"/></center>
            <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.ToolTip.html" title="This class holds information about a tooltip associated with a window (see wx.Window.SetToolTip )." alt="" coords="5,82,110,111"/> <area shape="rect" id="node2" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="8,5,107,34"/> </map> 
         </p>
      </div>
   </div>
   <script type="text/javascript" src="_static/inheritancetoggle.js"></script>



|


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

================================================================================ ================================================================================
:meth:`~wx.ToolTip.__init__`                                                     Constructor.
:meth:`~wx.ToolTip.Enable`                                                       Enable or disable tooltips globally.
:meth:`~wx.ToolTip.GetTip`                                                       Get the tooltip text.
:meth:`~wx.ToolTip.GetWindow`                                                    Get the associated window.
:meth:`~wx.ToolTip.SetAutoPop`                                                   Set the delay after which the tooltip disappears or how long a tooltip remains visible.
:meth:`~wx.ToolTip.SetDelay`                                                     Set the delay after which the tooltip appears.
:meth:`~wx.ToolTip.SetMaxWidth`                                                  Set tooltip maximal width in pixels.
:meth:`~wx.ToolTip.SetReshow`                                                    Set the delay between subsequent tooltips to appear.
:meth:`~wx.ToolTip.SetTip`                                                       Set the tooltip text.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.ToolTip.Tip`                                                          See :meth:`~wx.ToolTip.GetTip` and :meth:`~wx.ToolTip.SetTip`
:attr:`~wx.ToolTip.Window`                                                       See :meth:`~wx.ToolTip.GetWindow`
================================================================================ ================================================================================


|


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


.. class:: wx.ToolTip(Object)

   **Possible constructors**::

       ToolTip(tip) -> None
       
   
   This class holds information about a tooltip associated with a window
   (see `Window.SetToolTip()).`



   .. method:: __init__(self, tip)

      Constructor. 
                 


      :param `tip`: 
      :type `tip`: string




      :rtype: `None`     








   .. staticmethod:: Enable(flag)

      Enable or disable tooltips globally. 
                 


                


      :param `flag`: 
      :type `flag`: bool




      :rtype: `None`     







      .. note:: 

         May not be supported on all platforms (eg. Cocoa).   








   .. method:: GetTip(self)

      Get the tooltip text. 
                 

      :rtype: `str`








   .. method:: GetWindow(self)

      Get the associated window. 
                 

      :rtype: :ref:`wx.Window`








   .. staticmethod:: SetAutoPop(msecs)

      Set the delay after which the tooltip disappears or how long a tooltip remains visible. 
                 


                


      :param `msecs`: 
      :type `msecs`: long




      :rtype: `None`     







      .. note:: 

         May not be supported on all platforms (eg. Cocoa, GTK).   








   .. staticmethod:: SetDelay(msecs)

      Set the delay after which the tooltip appears. 
                 


                


      :param `msecs`: 
      :type `msecs`: long




      :rtype: `None`     







      .. note:: 

         May not be supported on all platforms.   








   .. staticmethod:: SetMaxWidth(width)

      Set tooltip maximal width in pixels. 
                 

      By default, tooltips are wrapped at a suitably chosen width. You can pass -1 as `width`  to disable wrapping them completely, 0 to restore the default behaviour or an arbitrary positive value to wrap them at the given width. 

      Notice that this function does not change the width of the tooltips created before calling it. 


                


      :param `width`: 
      :type `width`: int




      :rtype: `None`     







      .. note:: 

         Currently this function is MSW-only.   








   .. staticmethod:: SetReshow(msecs)

      Set the delay between subsequent tooltips to appear. 
                 


                


      :param `msecs`: 
      :type `msecs`: long




      :rtype: `None`     







      .. note:: 

         May not be supported on all platforms (eg. Cocoa, GTK).   








   .. method:: SetTip(self, tip)

      Set the tooltip text. 
                 


      :param `tip`: 
      :type `tip`: string




      :rtype: `None`     








   .. attribute:: Tip

      See :meth:`~wx.ToolTip.GetTip` and :meth:`~wx.ToolTip.SetTip`


   .. attribute:: Window

      See :meth:`~wx.ToolTip.GetWindow`

