How to get Widget Button Name Reference?

Hi, have this setup for a numpad widget that appends the number of a pressed button to an output textblock.
I was wondering if there’s a way to access the value of the text that’s parented to the button that was pressed so I don’t have to type in the respective number each time in the Append node or get the specific object reference of the button each time.
Does anyone know?

Hi and welcome!
You could achieve that with creating your own widget class with a button, but it requires some work. You need to add OnClicked event dispatcher in that class and an int variable with number. You could even add that number to OnClidked so you would have that data available immediately.
But depending on how experienced you are with Unreal Engine, with 10 numbers it could be faster just to append them :slight_smile:

EDIT: You can also do it like that (To is empty), but it doesn’t feel super correct in long term.

1 Like

The buttons should be wrapped in user widgets and dispatch associated data.

1 Like

Thank you for the replies!
For now I got it working by manually appending the values for each button event individually, as I’m fairly new to unreal.
I’ll have to look into your suggestions, but thanks for pointing me in the right direction!
(which is learning about event dispatchers I assume)