With Exit you can cancel and completely stop the app.

app.Exit( kill )

You can also forcefully kill the app by passing true as first argument.

Example - Exit dialog click to expand contents