<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<!-- THIS FILE IS GENERATED DO NOT EDIT -->


<erlref>
<header>
  <copyright>
    <year>2020</year><year>2021</year>
    <holder>wxWidgets team.</holder></copyright>
  <legalnotice>Licensed under the wxWindows Free Documentation Licence, Version 3
  </legalnotice>
  <title>wxIdleEvent</title>
</header>
<module>wxIdleEvent</module>
<modulesummary>Functions for wxIdleEvent class</modulesummary>
<description><p>This class is used for idle events, which are generated when the system becomes idle. 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.
      </p><p>If you need to ensure a continuous stream of idle events, you can either use <seemfa marker="#requestMore/2"><c>requestMore/2</c></seemfa> method in your handler or call ?wxWakeUpIdle() periodically (for example from a timer event handler), but note that both of these approaches (and especially the first one) increase the system load and so should be avoided if possible.
      </p><p>By default, idle events are sent to all windows, including even the hidden ones because they may be shown if some condition is met from their <c>wxEVT_IDLE</c> (or related <c>wxEVT_UPDATE_UI</c>) handler. The children of hidden windows do not receive idle events however as they can't change their state in any way noticeable by the user. Finally, the global <c>wxApp</c> (not implemented in wx) object also receives these events, as usual, so it can be used for any global idle time processing.
      </p><p>If sending idle events to all windows is causing a significant overhead in your application, you can call <seemfa marker="#setMode/1"><c>setMode/1</c></seemfa> with the value wxIDLE_PROCESS_SPECIFIED, and set the wxWS_EX_PROCESS_IDLE extra window style for every window which should receive idle events, all the other ones will not receive them in this case.
      </p><p>Delayed Action Mechanism</p> <p><seeerl marker="wxIdleEvent"><c>wxIdleEvent</c></seeerl> can be used to perform some action "at slightly later time". This can be necessary in several circumstances when, for whatever reason, something can't be done in the current event handler. For example, if a mouse event handler is called with the mouse button pressed, the mouse can be currently captured and some operations with it - notably capturing it again - might be impossible or lead to undesirable results. If you still want to capture it, you can do it from <c>wxEVT_IDLE</c> handler when it is called the next time instead of doing it immediately.
      </p> <p>This can be achieved in two different ways: when using static event tables, you will need a flag indicating to the (always connected) idle event handler whether the desired action should be performed. The originally called handler would then set it to indicate that it should indeed be done and the idle handler itself would reset it to prevent it from doing the same action again.
      </p> <p>Using dynamically connected event handlers things are even simpler as the original event handler can simply <c>wxEvtHandler::Connect()</c> (not implemented in wx) or <c>wxEvtHandler::Bind()</c> (not implemented in wx) the idle event handler which would only be executed then and could <c>wxEvtHandler::Disconnect()</c> (not implemented in wx) or <c>wxEvtHandler::Unbind()</c> (not implemented in wx) itself.
      </p> <p>See: <url href="https://docs.wxwidgets.org/3.1/overview_events.html#overview_events">Overview events</url>, <seeerl marker="wxUpdateUIEvent"><c>wxUpdateUIEvent</c></seeerl>, <c>wxWindow::OnInternalIdle</c> (not implemented in wx)
      </p>
  <p>This class is derived (and can use functions) from: 
    <seeerl marker="wxEvent"><c>wxEvent</c></seeerl></p>
  
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_idle_event.html">wxIdleEvent</url></p>
  </description><section><title>Events</title><p>Use <seemfa marker="wxEvtHandler#connect/3"><c>wxEvtHandler:connect/3</c></seemfa> with <seetype marker="#wxIdleEventType"><c>wxIdleEventType</c></seetype> to subscribe to events of this type.</p></section>
<datatypes>
    <datatype><name name="wxIdleEvent"/></datatype>
    <datatype><name name="wxIdle"/></datatype>
    <datatype><name name="wxIdleEventType"/></datatype></datatypes>

<funcs>
  <func>
    <name name="getMode" arity="0" clause_i="1" since=""/>
    <fsummary>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. </fsummary>
    <desc><p>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. 
      </p><p>See: <seemfa marker="#setMode/1"><c>setMode/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="requestMore" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>requestMore/2</c></fsummary>
  </func>
  
  <func>
    <name name="requestMore" arity="2" clause_i="1" since=""/>
    <fsummary>Tells wxWidgets that more processing is required. </fsummary>
    <desc><p>Tells wxWidgets that more processing is required. 
      </p><p>This function can be called by an OnIdle handler for a window or window event handler to indicate that wxApp::OnIdle should forward the OnIdle event once more to the application windows.
      </p><p>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.
      </p><p>See: <seemfa marker="#moreRequested/1"><c>moreRequested/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="moreRequested" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the OnIdle function processing this event requested more processing time. </fsummary>
    <desc><p>Returns true if the OnIdle function processing this event requested more processing time. 
      </p><p>See: <seemfa marker="#requestMore/2"><c>requestMore/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setMode" arity="1" clause_i="1" since=""/>
    <fsummary>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. </fsummary>
    <desc><p>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. 
      </p></desc>
  </func>
  </funcs>
</erlref>
