# wxIdleEvent Class Reference
[Events]

`#include </home/work/projects/wx/2.9/wx/interface/wx/event.h>`

Inheritance diagram for wxIdleEvent:
[legend]

## Detailed Description

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.

If you need to ensure a continuous stream of idle events, you can either use wxIdleEvent::RequestMore 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.

By default, idle events are sent to all windows (and also wxApp, as usual). 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.

## Events using this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxIdleEvent& event)

Event macros:

- EVT_IDLE(func):
  Process a `wxEVT_IDLE` event.

##

Library: wxBase
Category: Events

See also:
  Events and Event Handling, wxUpdateUIEvent, wxWindow::OnInternalIdle

## Public Member Functions

| wxIdleEvent ()
| Constructor.
bool | MoreRequested () const
| Returns true if the OnIdle function processing this event requested more processing time.
void | RequestMore (bool needMore=true)
| Tells wxWidgets that more processing is required.

## Static Public Member Functions

static wxIdleMode | 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.
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.

List of all members.

## Constructor & Destructor Documentation

wxIdleEvent::wxIdleEvent | ( |  | ) |

Constructor.

## Member Function Documentation

static wxIdleMode wxIdleEvent::GetMode | ( |  | ) | `[static]`

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 also:
  SetMode().

bool wxIdleEvent::MoreRequested | ( |  | ) | const

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

See also:
  RequestMore()

void wxIdleEvent::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:
  MoreRequested()

static void wxIdleEvent::SetMode | ( | wxIdleMode | mode | ) | `[static]`

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.

Parameters:

  | mode | Can be one of the wxIdleMode values. The default is wxIDLE_PROCESS_ALL.

|  | [ top ]