Type IdleEvent
object
--+
|
Object
--+
|
Event
--+
|
IdleEvent
This class is used for EVT_IDLE events, which are generated and sent
when the application becomes idle. In other words, the when the
event queue becomes empty then idle events are sent to all windows (by
default) and as long as none of them call RequestMore
then there are
no more idle events until after the system event queue has some normal
events and then becomes empty again.
By default, idle events are sent to all windows. If this is causing a
significant overhead in your application, you can call
wx.IdleEvent.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. Then idle events will only be sent
to those windows and not to any others.
Method Summary |
IdleEvent |
__init__ (self)
Constructor |
bool |
CanSend (win)
Returns True if it is appropriate to send idle events to this
window. (Static method)
|
int |
GetMode ()
Static method 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 method)
|
bool |
MoreRequested (self)
Returns True if the OnIdle function processing this event
requested more processing time. |
|
RequestMore (self,
needMore)
Tells wxWidgets that more processing is required. |
|
SetMode (mode)
Static method for specifying how wxWidgets will send idle events: to
all windows, or only to those which specify that they will process the
events. (Static method)
|
Property Summary |
|
thisown : The membership flag |
__init__(self)
(Constructor)
Constructor
-
- Returns:
-
IdleEvent
- Overrides:
wx.Event.__init__
|
MoreRequested(self)
Returns True if the OnIdle function processing this event
requested more processing time.
-
- Returns:
-
bool
|
RequestMore(self,
needMore=True)
Tells wxWidgets that more processing is required. This function can be
called by an EVT_IDLE handler for a window to indicate that the
application should forward the EVT_IDLE event once more to the
application windows. If no window calls this function during its
EVT_IDLE handler, then the application will remain in a passive event
loop until a new event is posted to the application by the windowing
system.
-
- Parameters:
needMore
(type=bool)
|
CanSend(win)
Returns True if it is appropriate to send idle events to this
window.
This function looks at the mode used (see wx.IdleEvent.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:
win
(type=Window)
- Returns:
-
bool
|
GetMode()
Static method 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
|
SetMode(mode)
Static method for specifying how wxWidgets will send idle events: to
all windows, or only to those which specify that they will process the
events.
The 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 only to windows that have
the wx.WS_EX_PROCESS_IDLE extra style
flag set. |
-
- Parameters:
mode
(type=int)
|
thisown
The membership flag
-
|