Open PunkDevloPer opened 1 year ago
I could be wrong here, but when you're calling self.destroy(), the method is going to destroy the Root object and all of it's descendants, thus closing out of the window. It might be better to use CTkFrame for the login and then destroy the frame once verification has been authorized. (Anyone can feel free to correct me if I am wrong, no hard feelings!)
Thank you very much, you are absolutely right, I am sorry if it was a bother, but I have already solved it, thank you very much.
How did you solved it?
I used withdraw instead of destroy in the function verificar_login
def verificar_login(self):
usuario = self.user_entry.get()
contrasena = self.pass_entry.get()
if database.validate_user_exists(usuario, contrasena):
self.withdraw() <- HERE
pswd.windowmanager()
I'm creating a new window from another one and then destroying the old one, but CTK gives me some strange errors even though the window is closed the error appears to occur with self.destroy() so I'm not sure if I'm using it the right way
this is my code
""" importar librerias """ import os import customtkinter as ctk import tkinter as tk from PIL import Image import database import password_management as pswd
class Root(ctk.CTk): def init(self): super().init() self.geometry("300x350") self.resizable(False, False) self.login()