0

What is the name of the event when the user clicks the X button at the upper right corner of the window? How will I override that function?

enter image description here

alyssaeliyah
  • 2,214
  • 6
  • 33
  • 80

1 Answers1

2
root = Tk.tk()
root.protocol('WM_DELETE_WINDOW', callback)

I believe

SamBG
  • 270
  • 4
  • 16
  • 1
    Thank you for the code snippet, which might provide some limited, immediate help. A proper explanation would greatly improve its [long-term value](https://meta.stackexchange.com/q/114762/206345) by describing why this is a good solution to the problem, and would make it more useful to future readers with other similar questions. Please edit your answer to add some explanation, including the assumptions you've made. – sepehr Oct 23 '18 at 15:13