title: How to exit a Kivy application using a button
body: <p>I'm just learning Python and the Kivy framework. I can't seem to find any specific complete examples of being able to gracefully exit a Kivy app using code linked to a button.</p>
  
  <p>I have found Kivy code snippets like this</p>
  
  <pre><code>Button:
      id:btnExit
      text:"Exit"
      on_press: app.Exit()
  </code></pre>
  
  <p>But not any matching code that implements the <code>app.Exit()</code> call. Everything I've tried stops code execution but doesn't clean up the program window.</p>
  
  <p>I've read that Android and iOS style guides state that a program is not to programmatically exit and let the OS handle it but I am developing fullscreen borderless Desktop app and need a way to exit the program with a button press.</p>