HaxeUI Tutorial

Communication Between Widgets

John Gabriele

If you want one widget to be able to talk to another widget, you can create static variables for your widgets. Then initialize them inside the function passed into app.ready so that all your handlers can easily access them.

For example, suppose you want to make a button that increments a counter (a number written on a Label).

assets/main.xml:

And in your src/Main.hx:

This gets you (after a few clicks):