How to quit the main loop?

I’m new to this forum, so I hope that I don’t make any mistake :slight_smile:

My question:
I have a PGButton in my Panda application and a function that is executed when I click on the button. However, I want that a click on this button terminates the program but I just don’t find a possibility to do this inside the callback function. If I write


it closes the window, but does not terminate the program. I tried instead to close the framework like this:


But it would give me an error.
Can anyone help me, please :question:

Try framework.set_exit_flag().


It works now :slight_smile:
Thank you very much!