.. 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 `, :meth:`wx.EventLoopBase.YieldFor`
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
ThreadEvent:
|
|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 `) 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) -> None
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
: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 `) 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)
Sets the extra information value.
:param `extraLong`:
:type `extraLong`: long
:rtype: `None`
.. method:: SetInt(self, intCommand)
Sets the integer value.
:param `intCommand`:
:type `intCommand`: int
:rtype: `None`
.. method:: SetString(self, string)
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`