[HELP] Question ABOUT A KWGT Widget

I have been deep diving into KWGT widgets. Both as inspiration to create my own and in an attempt to discover widgets that I might want to modify, and I came upon a widget which has three buttons on the interface; “Clock” (Date & Time), “Weather”, (&) “Now Playing”. With these three buttons, the user was able to press them in order to swap through the different interfaces and see the different panelling, (self-EXPLANATORY based on the names of the titles),

I was wondering what the process behind achieving this function in a KWGT widget was. And whether someone might be able to break it down and take me through the process. If anyone can describe it step-by-step, it would be much appreciated and much obliged.

Thank you Kustom Forum!

Each panel is added as seperate layer (probably as an overlap group). The visibility of each layer is fixed using an If formula. A list variable is created in globals with values 1, 2 and 3. When each button is pressed, a specific value is set. For eg. Now playing sets the value of the variable to 2. The visibility of Now Playing layer is set to Always if the value of variable is 2 and never if not. Likewise, for each layer visibility is set.

Hope you got it.