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

==========================================================================================================================================
|phoenix_title|  **wx.ThreadEvent**
==========================================================================================================================================

This class adds some simple functionality to :ref:`wx.Event`  to facilitate inter-thread communication. 
         

This event is not natively emitted by any control/class: it is just a helper class for the user. Its most important feature is the :meth:`~wx.ThreadEvent.GetEventCategory`  implementation which allows thread events **NOT**  to be processed by :meth:`wx.EventLoopBase.YieldFor`   calls (unless the  ``wxEVT_CATEGORY_THREAD``   is specified - which is never in  code). 








         



.. versionadded:: 2.9.0 
     







.. seealso:: :ref:`Multithreading Overview <multithreading overview>`, :meth:`wx.EventLoopBase.YieldFor`   







|

|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>ThreadEvent</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.ThreadEvent_inheritance.svg" alt="Inheritance diagram of ThreadEvent" 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.ThreadEvent.html" title="This class adds some simple functionality to wx.Event  to facilitate inter-thread communication." alt="" coords="5,159,150,188"/> <area shape="rect" id="node2" href="wx.Event.html" title="An event is a structure holding information about an event passed to a callback or member function." alt="" coords="31,82,125,111"/> <area shape="rect" id="node3" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="28,5,127,34"/> </map> 
   </p>
   </div>

|


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

================================================================================ ================================================================================
:meth:`~wx.ThreadEvent.__init__`                                                 Constructor.
:meth:`~wx.ThreadEvent.Clone`                                                    Clones this event making sure that all internal members which use ``COW`` (only  ``m_commandString``   for now; see  :ref:`Reference Counting <reference counting>`) are unshared (see :meth:`wx.Object.UnShare` ).
:meth:`~wx.ThreadEvent.GetEventCategory`                                         Returns  ``wxEVT_CATEGORY_THREAD`` .
:meth:`~wx.ThreadEvent.GetExtraLong`                                             Returns extra information integer value.
:meth:`~wx.ThreadEvent.GetInt`                                                   Returns stored integer value.
:meth:`~wx.ThreadEvent.GetString`                                                Returns stored string value.
:meth:`~wx.ThreadEvent.SetExtraLong`                                             Sets the extra information value.
:meth:`~wx.ThreadEvent.SetInt`                                                   Sets the integer value.
:meth:`~wx.ThreadEvent.SetString`                                                Sets the string value.
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.ThreadEvent.EventCategory`                                            See :meth:`~wx.ThreadEvent.GetEventCategory`
:attr:`~wx.ThreadEvent.ExtraLong`                                                See :meth:`~wx.ThreadEvent.GetExtraLong` and :meth:`~wx.ThreadEvent.SetExtraLong`
:attr:`~wx.ThreadEvent.Int`                                                      See :meth:`~wx.ThreadEvent.GetInt` and :meth:`~wx.ThreadEvent.SetInt`
:attr:`~wx.ThreadEvent.String`                                                   See :meth:`~wx.ThreadEvent.GetString` and :meth:`~wx.ThreadEvent.SetString`
================================================================================ ================================================================================


|


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


.. class:: wx.ThreadEvent(Event)

   **Possible constructors**::

       ThreadEvent(eventType: EventType=wxEVT_THREAD, id: int=ID_ANY) -> None
       
   
   This class adds some simple functionality to Event to facilitate
   inter-thread communication.



   .. method:: __init__(self, eventType: EventType=wxEVT_THREAD, id: int=ID_ANY)

      Constructor. 
                 


      :param `eventType`: 
      :type `eventType`: wx.EventType
      :param `id`: 
      :type `id`: int




      :rtype: `None`     








   .. method:: Clone(self)

      Clones this event making sure that all internal members which use ``COW`` (only  ``m_commandString``   for now; see  :ref:`Reference Counting <reference counting>`) are unshared (see :meth:`wx.Object.UnShare` ). 
                 

      :rtype: :ref:`wx.Event`








   .. method:: GetEventCategory(self)

      Returns  ``wxEVT_CATEGORY_THREAD`` .  
                 

      This is important to avoid unwanted processing of thread events when calling :meth:`wx.EventLoopBase.YieldFor` . 
                 

      :rtype: :ref:`wx.EventCategory`








   .. method:: GetExtraLong(self)

      Returns extra information integer value. 
                 

      :rtype: `int`








   .. method:: GetInt(self)

      Returns stored integer value. 
                 

      :rtype: `int`








   .. method:: GetString(self)

      Returns stored string value. 
                 

      :rtype: `str`








   .. method:: SetExtraLong(self, extraLong : int)

      Sets the extra information value. 
                 


      :param `extraLong`: 
      :type `extraLong`: long




      :rtype: `None`     








   .. method:: SetInt(self, intCommand : int)

      Sets the integer value. 
                 


      :param `intCommand`: 
      :type `intCommand`: int




      :rtype: `None`     








   .. method:: SetString(self, string : str)

      Sets the string value. 
                 


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




      :rtype: `None`     








   .. attribute:: EventCategory

      See :meth:`~wx.ThreadEvent.GetEventCategory`


   .. attribute:: ExtraLong

      See :meth:`~wx.ThreadEvent.GetExtraLong` and :meth:`~wx.ThreadEvent.SetExtraLong`


   .. attribute:: Int

      See :meth:`~wx.ThreadEvent.GetInt` and :meth:`~wx.ThreadEvent.SetInt`


   .. attribute:: String

      See :meth:`~wx.ThreadEvent.GetString` and :meth:`~wx.ThreadEvent.SetString`