A convenience class for wx.Timer
, that calls the given callable
object once after the given amount of milliseconds, passing any
positional or keyword args. The return value of the callable is
available after it has been run with the GetResult
method.
If you don’t need to get the return value or restart the timer then there is no need to hold a reference to this object. CallLater maintains references to its instances while they are running. When they finish, the internal reference is deleted and the GC is free to collect naturally.
See also
Constructs a new |
|
Returns the value of the callable. |
|
Returns whether or not the callable has run. |
|
The timer has expired so call the callable. |
|
(Re)set the args passed to the callable object. This is |
|
(Re)start the timer |
|
Stop and destroy the timer. |
|
See |
|
See |
wx.
CallLater
(object)¶A convenience class for wx.Timer
, that calls the given callable
object once after the given amount of milliseconds, passing any
positional or keyword args. The return value of the callable is
available after it has been run with the GetResult
method.
If you don’t need to get the return value or restart the timer then there is no need to hold a reference to this object. CallLater maintains references to its instances while they are running. When they finish, the internal reference is deleted and the GC is free to collect naturally.
See also
__init__
(self, millis, callableObj, *args, **kwargs)¶Constructs a new wx.CallLater
object.
millis (int) – number of milliseconds to delay until calling the callable object
callableObj (PyObject) – the callable object
args – arguments to be passed to the callable object
kw – keyword arguments to be passed to the callable object
GetInterval
(self)¶GetResult
(self)¶Returns the value of the callable.
a Python object
result from callable
HasRun
(self)¶Returns whether or not the callable has run.
bool
IsRunning
(self)¶Notify
(self)¶The timer has expired so call the callable.
SetArgs
(self, *args, **kwargs)¶(Re)set the args passed to the callable object. This is
useful in conjunction with Start
if
you want to schedule a new call to the same callable
object but with different parameters.
args – arguments to be passed to the callable object
kw – keywords to be passed to the callable object
Start
(self, millis=None, *args, **kwargs)¶(Re)start the timer
millis (int) – number of milli seconds
args – arguments to be passed to the callable object
kw – keywords to be passed to the callable object
Stop
(self)¶Stop and destroy the timer.
__del__
(self)¶Interval
¶See GetInterval