uni-events-2.2.0.0: Event handling for the uniform workbench

Events.Examples

Description

Examples is meant to contain examples of using events which are too small to go into their own module.

Synopsis

Documentation

watch :: Event a -> IO (Event a, IO ())Source

watch is used for events like mouse motion events where if we can't find time we don't want them queued. The event returned waits until the original event next happens and returns it. A worker thread is needed to run this; the attached action should be used to stop that thread when we are no longer interested.

spawnRepeatedEvent :: Event () -> IO (IO ())Source

spawnRepeatedEvent concurrently syncs on the event until the given action is used; it is somewhat safer than spawnEvent. It also never interrupts the handler event attached to the event.