Description Usage Arguments Details Value Author(s) References
GLib provides an event-loop to all GLib-based libraries and applications. RGtk2 is one such library.
1 2 3 | gTimeoutAdd(interval, f, data = NULL)
gIdleAdd(f, data = NULL)
gSourceRemove(id)
|
interval |
The time interval which determines the frequency of the handler call |
f |
An R function that is called by the loop |
data |
Any R object that is passed to the R function as the last parameter |
id |
The source id obtained when adding a handler |
The RGtk2 user has limited control over the event loop, but it still possible to
register handlers as either timeout or idle tasks. A handler may be any R
function, though it must return TRUE
as long as it wants to stay connected
to the loop.
Timeout tasks are performed once per some specified interval of time. Use
gTimeoutAdd
to register such a handler.
When the event loop is idle (not busy) it will execute the idle handlers, which
may be registered with gIdleAdd
.
If one needs to externally remove a handler from the loop, gSourceRemove
will serve this purpose.
gIdleAdd
and gTimeoutAdd
both return a source id that may be used
to remove the handler later.
Michael Lawrence
https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.