How can I change text from a widget child

Hi, I’m reworking the settings menu from my project and I’d like to do it in a “modular” way. I would like to use the same button widget for all the settings, and I know how to get the buttons to work using event dispatchers, but how can I change the index text? In my original menu the index texts are binded to functions, and binding this index test to a text variable, then setting the variable to whichever text I want doesn’t work

Hey @JasonKorda!

So one thing you can do is use the “SetText (widget)” node- which will override any bindings.
You will need to have the button widgets added to the parent WBP, then have them marked as variable. Then you should be able to get that button, get your text variable (make sure that is set as variable on the button) and “set text” to whatever you’d like.

You will likely need to do this for each button, though you can make a function with an input of that widget type and a text value to shorten it for reuse. :slight_smile:

1 Like

I ended up working through the variable! It was a mistake on my side, although I didn’t not SetText overrides variables, so thank you! Would you happen to also know how to send a variable through an event dispatcher? I’d like to get the value of a slider from the “on value changed” event :sweat_smile:

You may not NEED to use an event dispatcher. Can you be more specific with what you’re trying to do and include any screenshots? You may be able to get a reference and then just have a function do all the work, instead of sending a dispatch. Thanks! :slight_smile:

1 Like

Yes! So I made a widget for the buttons to replace the ones in my project’s settings menu and I am dropping them in the settings widget, like this:

set1

And this is what the button widget has inside:

set2

set3

“update”:
I figured it out by myself while taking the screenshots for the post and then I read what you edited on your last post :upside_down_face: great minds think alike I guess!

I made a variable inside the button widget:

And set the variable from the settings menu:

Thank you very much for the help!!!

2 Likes