Need example of the cycle of changing widget values

Hello!
I need some help with this idea.
It’s a grid with buttons on the picture. And some letters array. I have to send a variable to the widget, according to which the letters should change the cell to the value of the variable.
I’m thinking about loop ofc but i don’t know how can i make the last index - thw first and etc. So i need an example.

320094-900890.png

This is not changing any values per se, it’s just swapping elements around. May or may not be more efficient or desired - depends on what they are and what needs copying (blueprints copy a lot).

But that’s what I understood from the pic.


If you do not wish to move widgets around, because the slot formatting gets messy, for example - you can add the values to an array and manipulate their order in the very same fashion.

Then, rather than repopulating the container, you’d push the newly ordered values into the widgets.

  • Insert Last Index at 0
  • Remove last Index
  • repopulate widget container

Image from Gyazo

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.

“Variable” here is a loop index. How many times i need to do situation on the picture.
Sorry, i have to clarify - on the picture i have buttons and i need simply swap text on the button. I think that’s enough for my task.

It worked! Thanks!