I´m trying to react with an exception when my tkinter window is closed with X, so that I can handle some database things in main before leaving. The Exception get´s thrown but not propagated - is there any reason for that? I can help myself with a global class Variable... but i wonder why this is like that.
class GuiBase(GuiConst):
def __init__(self):
super().__init__()
self.root = Tk() # create root window
.
.
.
self.root.protocol('WM_DELETE_WINDOW', self.on_closing)
def on_closing(self):
if messagebox.askokcancel("Quit", "Programm beenden?"):
self.root.destroy()
raise exception.WindowClosedWithX
I expected the Exception beeing propagiated, i can see it is thrown but not propagiated