I am trying to execute a function with the closing event: self.toplevel_1.protocol ('WM_DELETE_WINDOW', lambda: self.close_windows (3)) but it does not execute, I have thought that it has to do with the window manager since it I have removed and I have an independent closing button, I have looked for some other closing event for windows without the window manager but I can't find it, I would like to know if there is any closing event for this case, thank you very much.
def windows_open(self):
self.Toplevel_3 = Toplevel(self)
#self.toplevel_3 .protocol('WM_DELETE_WINDOW',
lambda: self.close_windows(3)) # ancient
self.toplevel_STUF.bind('<Destroy>',lambda e: self.close_windows(3))
def close_windows((self, number, event=None):
var = event.widget()
if number is 3:
if var is: # How `var` gives an error, I don't know what it returns, here I stay
self.toplevel_3. destroy()
self._open_3 = False
#.....
self.toplevel_3. destroy(), why the space there?close_windows()function, doesself.toplevel_3.quit()work instead ofself.toplevel_3.destroy()?