OnClick Event to External Button

Get the button and bind the event

127158-widgetgetbutton.jpg

I hope I understood the question correctly

Hi, Everybody. Everything ok? I hope yes.

I have two widgets. The first widget a have a button. I need access the OnClick Event from the second widget. because, the first widget is a child of the second widget. How could I make it?


if it possible, please, someone could post some print screen to exemplify. I am a beginner.

Thank you

Hi, . First, thank you. So, I have a UniformGridBox and I have 6 buttons with different names, How could I get the specific name click button. For example ( button 1 clicked ) ( button 2 clicked ) Do you need the same print screen to help me? Please, let me know and I post it to you.

There are many ways you could do this.

You could do what I showed in the picture with each button. You would end up with 6 different OnClick events.

Another way is to make an event dispatcher in the widget that has the buttons, with an integer argument. Call it every time one of the buttons get’s clicked. Then in the second widget just bind that event and use the integer with a switch to do the button-specific task.

, I’m sorry, but I’m a beginner and I’m studying very hard. Please, could you post a print screen step by step? It’s very important to me be learning. and thank you.

I made a video showing the two methods I mentioned before: 2017 02 21 12 49 27 - YouTube

Let me know if this is not what you were asking.

First, Your answer was very great. thank you. but I have a Uniform Grid Box and the widget buttons as a child. I put the buttons on my grid box dynamically and I need to get the name button when it was clicked.


Thank you my friend

Create an event dispatcher in the widget that has the button like this:

127185-onclickecbutton1.jpg

Then bind the event when you add the widget as child:

1 Like

OnClickedButton is an event dispatcher (also called delegates). Event dispatchers are under variables, in the My Blueprint tab of your widget.

You create it, name it and set input parameters. Then you can call it.

All the events binded to that event dispatcher will be executed when it’s called.

In this case I created one called OnClickedButton, and set the input parameter to be of type Button, named Button.

Thank you so much, . I appreciate so much your help.

Thanks, for the info

I’m facing a similar problem as well. Anybody have a clue?

Ditto, looking for a simpler solution… any developments? Maybe somethign with enhanced input mapping working for onclicked?