@:xml('
<hbox>
<button id="b1" text="b1" />
<button id="b2" text="b2" />
</hbox>
')
class View extends HBox {
public function new() {
super();
}
@:bind(b1, UIEvent.CHANGE)
function onB1( event: UIEvent ) {
trace('b1');
}
@:bind(b2, MouseEvent.CLICK)
function onB2( event: MouseEvent ) {
trace('b2');
}
}
And i just get some warnings when the project starts.
haxe/ui/macros/Macros.hx:274: WARNING: could not find component to regsiter event (b2)
haxe/ui/macros/Macros.hx:274: WARNING: could not find component to regsiter event (b1)
Meanwhile I’ve found another strange issue trying to bind an event in a class that create and shows another component (in fact i’m opening a settings view from a component and I need to run something on the component after the settings view is closed )
In the main component class (myTool) I have this
var settingsView = new MySettings(this);
[see code blocks below]
mainview.addComponent(settingsView);