I need to do some actions before quit (save settings, etc.), I do it with Button widgets, but if I press on close button of the window, it just closes. Maybe I should handle App's on_close()
event somehow? Then I don't know how to send data from Layout to App. For now I have smth like:
def quit_game(self):
# Saving different data.
...
quit()
What should I do?