This class is used for idle events, which are generated when the system is idle.

By default, idle events are sent to all windows. If this is causing a significant overhead in your application, you can call wxIdleEvent::SetMode with the value wxIDLE_PROCESS_SPECIFIED, and set the wxWS_EX_PROCESS_IDLE extra window style for every window which should receive idle events.

The function wxWindow::OnInternalIdle is also provided for internal purposes, and cannot be disabled. wxUpdateUIEvents are sent from OnInternalIdle.

Derived from


Include files


Event table macros

To process an idle event, use this event handler macro to direct input to a member function that takes a wxIdleEvent argument.

EVT_IDLE(func) Process a wxEVT_IDLE event.


Idle events can be caught by the wxApp class, or by top-level window classes.

See also

Event handling overview, wxUpdateUIEvent, wxWindow::OnInternalIdle





static bool CanSend(wxWindow* window)

Returns true if it is appropriate to send idle events to this window.

This function looks at the mode used (see wxIdleEvent::SetMode), and the wxWS_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 wxIDLE_PROCESS_ALL. You can change the mode to only send idle events to windows with the wxWS_EX_PROCESS_IDLE extra window style set.

See also



static wxIdleMode GetMode(void)

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.

See wxIdleEvent::SetMode.


void RequestMore(bool 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 wxApp::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.

See also



bool MoreRequested(void) const

Returns true if the OnIdle function processing this event requested more processing time.

See also



static void SetMode(wxIdleMode 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. The default is wxIDLE_PROCESS_ALL.

enum wxIdleMode
        // Send idle events to all windows

        // Send idle events to windows that have
        // the wxWS_EX_PROCESS_IDLE flag specified
ymasuda 平成17年11月19日