.. 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.png" 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="wx.ThreadEvent" alt="" coords="5,160,132,189"/> <area shape="rect" id="node2" href="wx.Event.html" title="wx.Event" alt="" coords="27,83,110,112"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="25,5,112,35"/> </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=wxEVT_THREAD, id=ID_ANY)
       
   
   This class adds some simple functionality to Event to facilitate
   inter-thread communication.



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

      Constructor.                  


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







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








   .. method:: GetInt(self)

      Returns stored integer value.                  

      :rtype: `int`








   .. method:: GetString(self)

      Returns stored string value.                  

      :rtype: `string`








   .. method:: SetExtraLong(self, extraLong)

      Sets the extra information value.                  


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







   .. method:: SetInt(self, intCommand)

      Sets the integer value.                  


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







   .. method:: SetString(self, string)

      Sets the string value.                  


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







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

