Too bad. I was hoping this time I missed something. I come from a Java/JavaFX
background and there each element from GUI have at one point in their parent/child hierarchy the same parent that contains all the mouse events as well as key press/released/typed events, and other more general events, and so you have access to them on each element and not just that scene/widget equivalent in Unreal Engine. Which in some situations are extremely useful.
Yeah, that was the way I was going to go with, because even if you have a button with other elements in a widget created inside another widget, and you want that button to do something different for each instance of that child widget, you can simply get “child widget” → get button → Bind Event To on X.
I had a few similar situation and I applied what I said above, but the difference is that in my case I only had 1 layer (main widget, and a child widget inside it with the button), and I could easily reach the button, and not had to call X gets to reach it.
A bit easier for me if I had a situation where I would have a widget inside another, inside another… which in the end has the button I would need to do something different each time, is that for each child widget I would create a function “Get Button” which would return the “Get Button” function from it’s child, until I reach the bottom child, where “Get Button” function would return the button itself. And so inside the main widget I could simply use “child widget” → Get Button → Bind Event to On Clicked.
A visual representation simplified:
Bottom widget that has the button itself:
1 layer/widget higher:
2 layers/widgets higher:
… how many layers/widgets higher you would have…
Top layer/widget:
Like he said it isn’t an elegant solution, but at least it is only tedious and not hard to implement. I’m the only one working on my project/game, and so, even if some things might be tedious, I will give in and make something like the hierarchy I said above, only to keep it going, and not get stuck in trying to get a better/elegant solution, which in the end, giving in, is kinda better because I’ll get on with the project, but on the other hand, maybe if I spend more time to find a better solution, it would save me time in the future?! Pros and cons situation.