I recently started to learn LUA and have been slowly picking a few stuff up and currently am stuck trying to progress further with what I want to do. So far I've learned to create a frame, add a button, and a couple widgets to it. I've also been able to turn the button into something like a macro using SetAttribute("macrotext1", "/wave") but I have been unsuccessful trying to figure out how to press a button that shows a new frame while hiding the current frame. Basically like almost turning a page.
I have managed to create a new frame by pressing the button but this creates a new frame outside of the existing one by doing something like this.
But as mentioned this only created a brand new frame. I would appreciate any help or if there is somewhere I can get this info that is easy to digest. I tried looking at other addons but the amount of code inside those folders is very overwhelming since I am not quite sure what I need to be looking for.