+static void text_append_to(Widget w, String str)
+/* append text to a specified text widget */
+{
+ XawTextBlock txtblk;
+ XawTextPosition textend = XawTextGetInsertionPoint(w);
+
+ txtblk.ptr = str;
+ txtblk.length = strlen(str);
+ txtblk.firstPos = 0;
+ txtblk.format = FMT8BIT;
+
+ XawTextReplace(w, textend, textend, &txtblk);
+}
+
+static void noargs_proc(Widget w, XtPointer client_data, XtPointer call_data)
+/* use this for commands that take no arguments */
+{
+ /* currently a stub */
+ text_append_to(w, XtName(w));
+ printf("Button %s pressed\n", XtName(w));
+}
+
+static struct cmd_t commands[] = {
+ {"Move", NULL, &navigation, 0},
+ {"Dock", noargs_proc, &navigation, 0},
+ {"Chart", noargs_proc, &navigation, 0},
+ {"Impulse", NULL, &navigation, 0},
+ {"Rest", NULL, &navigation, 0},
+ {"Warp", NULL, &navigation, 0},
+ {"Probe", NULL, &navigation, OPTION_PROBE},
+
+ {"Phasers", NULL, &weapons, 0},
+ {"Torpedo", NULL, &weapons, 0},
+ {"Shields", NULL, &weapons, 0},
+ {"Damages", noargs_proc, &weapons, 0},
+ {"Abandon", noargs_proc, &weapons, 0},
+ {"Destruct", noargs_proc, &weapons, 0},
+ {"Deathray", noargs_proc, &weapons, 0},
+ {"Mayday", noargs_proc, &weapons, 0},
+
+ {"Sensors", noargs_proc, &planets, OPTION_PLANETS},
+ {"Orbit", noargs_proc, &planets, OPTION_PLANETS},
+ {"Transport", noargs_proc, &planets, OPTION_PLANETS},
+ {"Mine", noargs_proc, &planets, OPTION_PLANETS},
+ {"Crystals", noargs_proc, &planets, OPTION_PLANETS},
+ {"Shuttle", noargs_proc, &planets, OPTION_PLANETS},
+ {"Planets", noargs_proc, &planets, OPTION_PLANETS},
+
+ {"Score", noargs_proc, &misc, 0},
+ {"Report", noargs_proc, &misc, 0},
+ {"Computer", noargs_proc, &misc, 0},
+ {"Save", NULL, &misc, 0},
+ {"Quit", quit_proc, &misc, 0},
+ {"Help", noargs_proc, &misc, 0},
+};
+
+static void instantiate_main(int argc, char **argv)