@on_trait_change('window:closing')
    def _prompt_on_close(self, event):
        if not self._prompt_for_save():
            event.veto = True
Prompt the user to save when exiting.
dataset/ETHPy150Open enthought/pyface/examples/tasks/basic/example_task.py/ExampleTask._prompt_on_close