Hi, I use Ctk to create a window saying there was a problem, and I want the button to first, destroy the window and the script to close.
Here's my code for this window:
if enter_key == "":
sleep(0.5)
print("\nNo license were entered.")
popup = ctk.CTkToplevel()
popup.geometry("300x200")
label = ctk.CTkLabel(popup, text="No license were entered.", text_color="white", font=("Arial", 16))
label.pack(pady=20)
ok_button = ctk.CTkButton(popup, text="OK", command=popup.destroy())
ok_button.pack(pady=10)
popup.mainloop()
time.sleep(2)
return False
I want to include a quit() when the OK button is pressed, I tried different things but nothing seems to work