1wxIdleEvent(3)             Erlang Module Definition             wxIdleEvent(3)
2
3
4

NAME

6       wxIdleEvent - Functions for wxIdleEvent class
7

DESCRIPTION

9       This class is used for idle events, which are generated when the system
10       becomes idle. Note that, unless you do something specifically, the idle
11       events  are  not sent if the system remains idle once it has become it,
12       e.g. only a single idle event will be generated  until  something  else
13       resulting  in more normal events happens and only then is the next idle
14       event sent again.
15
16       If you need to ensure a continuous stream of idle events, you  can  ei‐
17       ther  use  requestMore/2 method in your handler or call ?wxWakeUpIdle()
18       periodically (for example from a timer event handler),  but  note  that
19       both  of  these  approaches (and especially the first one) increase the
20       system load and so should be avoided if possible.
21
22       By default, idle events are sent to all  windows,  including  even  the
23       hidden  ones  because  they  may be shown if some condition is met from
24       their wxEVT_IDLE (or related wxEVT_UPDATE_UI) handler. The children  of
25       hidden  windows do not receive idle events however as they can't change
26       their state in any way noticeable by  the  user.  Finally,  the  global
27       wxApp  (not  implemented  in  wx) object also receives these events, as
28       usual, so it can be used for any global idle time processing.
29
30       If sending idle events to all windows is causing a significant overhead
31       in  your  application,  you  can  call  setMode/1  with  the value wxI‐
32       DLE_PROCESS_SPECIFIED, and set the  wxWS_EX_PROCESS_IDLE  extra  window
33       style  for every window which should receive idle events, all the other
34       ones will not receive them in this case.
35
36       Delayed Action Mechanism
37
38       wxIdleEvent can be used to  perform  some  action  "at  slightly  later
39       time".  This  can be necessary in several circumstances when, for what‐
40       ever reason, something can't be done in the current event handler.  For
41       example,  if  a  mouse  event  handler  is called with the mouse button
42       pressed, the mouse can be currently captured and some  operations  with
43       it  - notably capturing it again - might be impossible or lead to unde‐
44       sirable results. If you still want to capture it, you can  do  it  from
45       wxEVT_IDLE  handler when it is called the next time instead of doing it
46       immediately.
47
48       This can be achieved in two different ways: when using static event ta‐
49       bles,  you  will  need a flag indicating to the (always connected) idle
50       event handler whether the desired action should be performed. The orig‐
51       inally  called handler would then set it to indicate that it should in‐
52       deed be done and the idle handler itself would reset it to  prevent  it
53       from doing the same action again.
54
55       Using  dynamically  connected event handlers things are even simpler as
56       the original event handler can simply wxEvtHandler::Connect() (not  im‐
57       plemented  in  wx)  or wxEvtHandler::Bind() (not implemented in wx) the
58       idle event handler which would only be  executed  then  and  could  wx‐
59       EvtHandler::Disconnect()  (not  implemented in wx) or wxEvtHandler::Un‐
60       bind() (not implemented in wx) itself.
61
62       See: Overview events,  wxUpdateUIEvent,  wxWindow::OnInternalIdle  (not
63       implemented in wx)
64
65       This class is derived (and can use functions) from: wxEvent
66
67       wxWidgets docs: wxIdleEvent
68

EVENTS

70       Use  wxEvtHandler:connect/3 with wxIdleEventType to subscribe to events
71       of this type.
72

DATA TYPES

74       wxIdleEvent() = wx:wx_object()
75
76       wxIdle() = #wxIdle{type = wxIdleEvent:wxIdleEventType()}
77
78       wxIdleEventType() = idle
79

EXPORTS

81       getMode() -> wx:wx_enum()
82
83              Static function returning a value specifying how wxWidgets  will
84              send idle events: to all windows, or only to those which specify
85              that they will process the events.
86
87              See: setMode/1
88
89       requestMore(This) -> ok
90
91              Types:
92
93                 This = wxIdleEvent()
94
95       requestMore(This, Options :: [Option]) -> ok
96
97              Types:
98
99                 This = wxIdleEvent()
100                 Option = {needMore, boolean()}
101
102              Tells wxWidgets that more processing is required.
103
104              This function can be called by an OnIdle handler for a window or
105              window  event handler to indicate that wxApp::OnIdle should for‐
106              ward the OnIdle event once more to the application windows.
107
108              If no window calls this function during OnIdle, then the  appli‐
109              cation  will remain in a passive event loop (not calling OnIdle)
110              until a new event is posted to the application by the  windowing
111              system.
112
113              See: moreRequested/1
114
115       moreRequested(This) -> boolean()
116
117              Types:
118
119                 This = wxIdleEvent()
120
121              Returns  true  if  the OnIdle function processing this event re‐
122              quested more processing time.
123
124              See: requestMore/2
125
126       setMode(Mode) -> ok
127
128              Types:
129
130                 Mode = wx:wx_enum()
131
132              Static function for specifying  how  wxWidgets  will  send  idle
133              events: to all windows, or only to those which specify that they
134              will process the events.
135
136
137
138wxWidgets team.                     wx 2.1                      wxIdleEvent(3)
Impressum