Description Usage Arguments Details Value Author(s) Examples
Trigger a registered Event
1 | trigger.event(registry, event, ...)
|
registry |
EventRegistry |
event |
Name of event to trigger |
... |
Further parameters are passed to each handler in turn. |
Trigger a registered Event.
Every handler is called in turn. If any handler returns a value with a "CatchEvent" attribute set to TRUE then no further handlers are called. That attribute is removed from the return value and the value is returned to the triggering context. Otherwise the return value of only the last function is called.
If no handlers are registered then NULL is returned.
If no Event exists of that name then an error is thrown.
See Details
Brad Friedman
1 2 3 4 | r <- new.event.registry()
add.event(r, "mouseclick")
add.event.handler(r, "mouseclick", function(x, y) message("Mouse clicked at coordinates (", x, ", ", y, ")"))
trigger.event(r, "mouseclick", x = 30, y = 50)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.