+ XtAddCallback(state->goal, XmNexposeCallback, goal_expose, state);
+}
+
+static void dialog_close(Widget w, void *data, void *cb_data)
+{
+ XtDestroyWidget(w);
+}
+
+/*
+ * Expands to an XtVaSetValues argument list to set the given resource with
+ * a typed string value, which is internally converted to the appropriate
+ * resource type.
+ *
+ * Note that str is expanded twice and thus should not have side effects.
+ */
+#define STRING_ARG(resource, str) \
+ XtVaTypedArg, (resource), XtRString, (str), strlen((str))+1
+
+void ui_show_about(struct app_state *state, Widget shell)
+{
+ static const struct ui_widget dialog[] = { ABOUTDIALOG_INITIALIZER };
+ Widget w, l;
+ char *msg;
+
+ construct_widgets(dialog, shell, 0);
+
+ w = XtNameToWidget(shell, "*aboutDialog");
+ XtUnmanageChild(XmMessageBoxGetChild(w, XmDIALOG_CANCEL_BUTTON));
+
+ XtAddCallback(w, XmNunmapCallback, dialog_close, NULL);
+
+ XtVaSetValues(w, STRING_ARG(XmNokLabelString, "Close"), (char *)NULL);
+
+ msg = version_format_head("rrace-motif");
+ l = XmMessageBoxGetChild(w, XmDIALOG_MESSAGE_LABEL);
+ XtVaSetValues(l, XmNlabelType, XmSTRING,
+#if HAVE_MOTIF_PIXMAP_AND_STRING
+ XmNlabelType, XmPIXMAP_AND_STRING,
+#endif
+ XmNlabelPixmap, state->icon_pixmap,
+ STRING_ARG(XmNlabelString, msg),
+ (char *)NULL);
+ free(msg);
+
+ l = XtNameToWidget(w, "*licenseBlurb");
+ XmTextSetString(l,
+"This program is free software: you can redistribute it and/or modify\n"
+"it under the terms of the GNU General Public License as published by\n"
+"the Free Software Foundation, either version 3 of the License, or\n"
+"(at your option) any later version.\n\n"
+"This program is distributed in the hope that it will be useful,\n"
+"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+"GNU General Public License for more details.\n\n"
+"You should have received a copy of the GNU General Public License\n"
+"along with this program. If not, see <https://www.gnu.org/licenses/>.");
+
+ XtVaSetValues(l, XmNeditMode, XmMULTI_LINE_EDIT,
+ XmNeditable, FALSE,
+ XmNresizeWidth, TRUE,
+ XmNrows, 5,
+ (char *)NULL);
+
+ XtManageChild(w);