+
+ /**
+ * Ask the user and, if confirmed, close the {@link TApplication} this
+ * {@link TWidget} is running on.
+ * <p>
+ * This should result in the program terminating.
+ *
+ * @param widget
+ * the {@link TWidget}
+ */
+ static public void close(TWidget widget) {
+ close(widget.getApplication());
+ }
+
+ /**
+ * Ask the user and, if confirmed, close the {@link TApplication}.
+ * <p>
+ * This should result in the program terminating.
+ *
+ * @param app
+ * the {@link TApplication}
+ */
+ static void close(TApplication app) {
+ // TODO: i18n
+ if (app.messageBox("Confirmation", "(TODO: i18n) Exit application?",
+ TMessageBox.Type.YESNO).getResult() == TMessageBox.Result.YES) {
+ app.exit();
+ }
+ }