I don’t know if I misunderstood how this should work. I have some widgets and a base widget that has all the other widgets inside. Now I have buttons events in my widgets I want to forward to the base widget.
I make an Event Dispatcher and call that in the sub widgets from the button click events. In the base widgets I want to bind to the dispatcher using the UI:
But the resulting node never triggers. Does this not automatically bind to the event dispatcher? If not, why does this even exist? Or how is this supposed to be used?
Hold, Move, and Orbit are children user widgets, each with a (BTN) button. You do not need to implement any extra calls in the child for this either.
Now, every time the button is clicked in the child, it will fire the bound event in the parent widget.
You do want to create an additional dispatcher if you want to send some data back - like a color of the button, for example. The button’s onClicked sends just the execution, but no data.
edit: However, any Event Dispatchers declared in the Child User Widget become automagically available in the parent:
The difference here is that a user widget is a wrapper for whatever resides inside, so you need to access the elements inside this wrapper first - see the first pic - I need to get to the embedded button first to get to its event.
If you leave the dispatcher Call in the pic 1 as is, this Hello will trigger twice. Once through the button’s onClick and then through the Dispatcher call.
Yeah they become available, but when I call the event in the child widget like in my picture above, why does it not trigger in the parent widget when I add it with the plus? What else do I need to do?
Thank you for your commitment, I will take a look at it tomorrow, but it seems there is something else fishy about my setup if it’s supposed to work like this.
I tried this again today and looked over everything and there was nothing pointing me to any mistake I made. Then I tried this in a seperate project and it worked. Then I migrated these two widgets in my main project and there it worked too. Then I switched back to the widgets I actually wanted to use, and suddenly they worked too. What in the world… ??