create a widget for the button and add an int variable to it and make that variable “Editable” and “Expose on Spawn” enable.
add a horizontal box ( or something like that) in the main widget and make it variable.
now add created widget to your main widget with a loop and set that variable with the loop. I send my logic for you, check it in this link.
[Spawn Button logic][3]