Need example of the cycle of changing widget values

i have buttons and i need simply swap
text on the button

Add the text to an array, order it any way you need, and push it back into the widgets.

“Variable” here is a loop index.

You probably mean an array index.