Slate: How to pass a variable along in the OnClicked event for a button?
As the title says, I've got a button that I can click and a function is called - however, the OnClicked declaration shows a delegate to be passed with FReply as return value and no parameters.
Now it's absolutely essential that I can pass along a parameter to that delegate since I'm dynamically adding buttons while iterating through an array, and I need to pass a reference to the object in the array that the button represents so I can figure out which action to take.
Hopefully one of you guys have an answer to this :)
Thanks in advance!
asked Mar 26 '14 at 10:42 PM in C++ Programming
You're able to bind variables to a delegate; I can't remember the exact syntax when doing this inside Slate (nor the names of the delegate), but it would be something along the lines of:
MyVariableToBind would then be passed into SMyWidget::OnClicked as a parameter.
Slate might have the syntactic sugar to let you do that as (I'm not sure though, as I don't often have to bind variables to a delegate):
Follow this question
Once you sign in you will be able to subscribe for any updates here