************ wx.IdleEvent ************ Inheritance diagram for `wx.IdleEvent`: | .. inheritance-diagram:: wx.IdleEvent | Description =========== This class is used for idle events, which are generated when the system becomes idle. By default, idle events are sent to all windows (and also `wx.App <../Widgets/wx.App.html>`_, as usual). If this is causing a significant overhead in your application, you can call `SetMode <#SetMode>`_ with the value ``wx.IDLE_PROCESS_SPECIFIED``, and set the ``wx.WS_EX_PROCESS_IDLE`` extra window style for every window which should receive idle events. .. note:: Note that, unless you do something specifically, the idle events are not sent if the system remains idle once it has become it, e.g. only a single idle event will be generated until something else resulting in more normal events happens and only then is the next idle event sent again. If you need to ensure a continuous stream of idle events, you can either use `RequestMore <#RequestMore>`_ method in your handler or call `wx.WakeUpIdle <../wxFunctions.html#WakeUpIdle>`_ periodically (for example from timer event), but note that both of these approaches (and especially the first one) increase the system load and so should be avoided if possible. .. seealso:: `wx.UpdateUIEvent `_ Derived From ^^^^^^^^^^^^^ * `wx.Event `_ * `wx.Object <../Widgets/wx.Object.html>`_ Event Handling ^^^^^^^^^^^^^^ ================================================== ================================================== Event Name Description ================================================== ================================================== wx.EVT_IDLE(func) Process a ``wx.wxEVT_IDLE`` event. ================================================== ================================================== Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `CanSend <#CanSend>`_ * `GetMode <#GetMode>`_ * `MoreRequested <#MoreRequested>`_ * `RequestMore <#RequestMore>`_ * `SetMode <#SetMode>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__() Constructor. | **Returns:** `wx.IdleEvent <../Events/wx.IdleEvent.html>`_ -------- .. method:: CanSend(window) Returns ``True`` if it is appropriate to send idle events to this window. This function looks at the mode used (see `SetMode <#SetMode>`_ ), and the ``wx.WS_EX_PROCESS_IDLE`` style in `window` to determine whether idle events should be sent to this window now. By default this will always return ``True`` because the update mode is initially ``wx.IDLE_PROCESS_ALL``. You can change the mode to only send idle events to windows with the ``wx.WS_EX_PROCESS_IDLE`` extra window style set. **Parameters:** * `window` (`wx.Window <../Widgets/wx.Window.html>`_) | **Returns:** `bool` .. seealso:: `SetMode <#SetMode>`_ -------- .. method:: GetMode() Static function returning a value specifying how wxWidgets will send idle events: to all windows, or only to those which specify that they will process the events. | **Returns:** `int` .. seealso:: `SetMode <#SetMode>`_ -------- .. method:: MoreRequested() Returns ``True`` if the `OnIdle` function processing this event requested more processing time. | **Returns:** `bool` .. seealso:: `RequestMore <#RequestMore>`_ -------- .. method:: RequestMore(needMore=True) Tells wxWidgets that more processing is required. This function can be called by an `OnIdle` handler for a window or window event handler to indicate that `wx.App.OnIdle` should forward the `OnIdle` event once more to the application windows. If no window calls this function during `OnIdle`, then the application will remain in a passive event loop (not calling `OnIdle`) until a new event is posted to the application by the windowing system. **Parameters:** * `needMore` (bool) .. seealso:: `MoreRequested <#MoreRequested>`_ -------- .. method:: SetMode(mode) Static function for specifying how wxWidgets will send idle events: to all windows, or only to those which specify that they will process the events. `mode` can be one of the following values: * ``wx.IDLE_PROCESS_ALL``: Send idle events to all windows * ``wx.IDLE_PROCESS_SPECIFIED``: Send idle events to windows that have the ``wx.WS_EX_PROCESS_IDLE`` flag specified The default is ``wx.IDLE_PROCESS_ALL``. **Parameters:** * `mode` (int)