I want to have a login screen and when the login is successful, the screen is closed and a new screen is created. The problem is , when I do just like the following code , b
Slayer , I did like you said and it worked like a charm! Here is the example code:
from tkinter import *
class Tela_login(Frame):
def __init__(self,master):
Frame.__init__(self, master)
self.grid()
self.button1 = Button(text = "Open",command = lambda: self.open_login())
self.button1.grid()
def open_login(self):
root2 = Toplevel()
app2 = Tela_principal(root2)
class Tela_principal(Frame):
def __init__(self,master):
Frame.__init__(self, master)
self.grid
root = Tk()
root.geometry("800x600")
app = Tela_login(root)
root.mainloop()