Customtkinter Application wont end after pressing the x on the second window
22:13 20 Jul 2026
import customtkinter as ctk

master = ctk.CTk()
def open_window_button():
    newPlace = ctk.CTkToplevel(master)
    newPlace.title("peneer")
    newPlace.geometry("400x150")
    
    FinalEnd = ctk.CTkButton(master, anchor="SE", command=master.destory)
    FinalEnd.pack(padx=20, pady=20)



ctk.set_appearance_mode("dark")

window = ctk.CTk()
window.title("My Life")
window.geometry("400x150") 

button = ctk.CTkButton(window,anchor="center", text="Press me ;)", fg_color='#0e6b0e', hover_color='#149414', command=open_window_button, text_color="black")
button.pack(expand=True,padx=20, pady=20) 

window.mainloop()

new to programming so ill take all the criticism i can take on how terrible this code is.

im having trouble with the program stay running even after closing the windows. with my second button, "FinalEnd", i was hoping to make a button that would ultimately just quit the program all the together but that wouldnt show on my second window either. im just stuck and feel like im taking this project too far. i should probably take a bit to learn deeper into this subject? thoughts please.

python tkinter customtkinter