HaxeUI Tutorial

Event System

John Gabriele, Ian Harrigan

HaxeUI has its own event system, separate from and above any event systems in any of its back-ends.

When you register an event in haxeui-core (using registerEvent or an onClick/onChange shortcut), it sets up a listener inside the given component. It then calls mapEvent on the back-end (via ComponentImpl) which sets up the backend-specific event.

When an event fires, then the backend (via ComponentImpl) lets haxeui-core know, which then fires the appropriate user code that was registered via registerEvent.

As with most things HaxeUI, the event system inside haxeui-core is essentially a wrapper (of sorts) around any event system that exists in the backend.