So I'm trying to make a login app and want to add register option to it... I made a register button and I want it to switch from the login page to the register page without opening any new window (I'm basicly want it to switch between frame1 to frame2 and erase frame1's widgets and display frame2's widgets) the problem is that I'm new to tkinter and to python in general and Couldn't find a proper solution to it... here is a sample of my code that displays the tkinter pages (sorry if its a little long one... I've tried to make it as readable as possible so you would understand)
import tkinter as tk
from tkinter import *
from tkinter import ttk
class app:
def __init__(self, master):
self.frame1 = Frame(root, width=300, height=300)
self.frame1.pack()
self.reg_txt = ttk.Label(root, text='page1')
self.reg_txt.place(x=88, y=30)
class app2:
def __init__(self, master):
self.frame2 = Frame(root, width=300, height=300)
self.reg_txt2 = ttk.Label(root, text='page2')
self.reg_txt2.place(x=88, y=30)
self.frame2.pack()
root = Tk()
a = app(root)
a = app2(root)
root.mainloop()