trigger.event: trigger.event

Description Usage Arguments Details Value Author(s) Examples

View source: R/event.registry.R

Description

Trigger a registered Event

Usage

1
trigger.event(registry, event, ...)

Arguments

registry

EventRegistry

event

Name of event to trigger

...

Further parameters are passed to each handler in turn.

Details

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.

Value

See Details

Author(s)

Brad Friedman

Examples

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)

AnalysisPageServer documentation built on April 28, 2020, 6:32 p.m.