I want to run the command when I erase the window in Tkinter.

Asked 1 years ago, Updated 1 years ago, 68 views

I want to run the command when I erase the Toplevel window.
In the tk.Tk() window, you can overwrite _del__, but if you do so in Toplevel, it will run when the main window is turned off.
I think it's okay to make a separate button myself, but can't you run it with the delete button on the title bar?

python python3 tkinter gui

2022-09-30 11:19

1 Answers

I was able to use the following description.

<Toplevel>.protocol("WM_DELETE_WINDOW", <fnc>)


2022-09-30 11:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.