Mergeed "Status" section into "Misc".
[super-star-trek.git] / src / xio.c
index 6985cc9a7d01bbde9bc14be26bf6b8e17d75991b..2bdb4653d4ab0e38b4e75259a76ae693dbb6679e 100644 (file)
--- a/src/xio.c
+++ b/src/xio.c
@@ -10,8 +10,8 @@
 
 static XtAppContext app_context;
 static Widget toplevel, text, form; 
-static Widget navigation, weapons, status, planets, misc; 
-static Widget navlabel, weaplabel, statlabel, planlabel, misclabel;
+static Widget navigation, weapons, planets, misc; 
+static Widget navlabel, weaplabel, planlabel, misclabel;
 
 static String fallback[] = {
     /* text window resources */
@@ -39,6 +39,7 @@ static void noargs_proc(Widget w, XtPointer client_data, XtPointer call_data)
 /* use this for commands that take no arguments */
 {
     /* currently a stub */
+    printf("Button %s pressed\n", XtName(w));
 }
 
 static struct cmd_t commands[] = {
@@ -59,10 +60,6 @@ static struct cmd_t commands[] = {
     {"Deathray",       noargs_proc,    &weapons,       0},
     {"Mayday",         noargs_proc,    &weapons,       0},
 
-    {"Score",          noargs_proc,    &status,        0},
-    {"Report",         noargs_proc,    &status,        0},
-    {"Computer",       noargs_proc,    &status,        0},
-
     {"Sensors",                noargs_proc,    &planets,       OPTION_PLANETS},
     {"Orbit",          noargs_proc,    &planets,       OPTION_PLANETS},
     {"Transport",      noargs_proc,    &planets,       OPTION_PLANETS},
@@ -71,7 +68,9 @@ static struct cmd_t commands[] = {
     {"Shuttle",                noargs_proc,    &planets,       OPTION_PLANETS},
     {"Planets",                noargs_proc,    &planets,       OPTION_PLANETS},
 
-    {"Emexit",         noargs_proc,    &misc,          0},
+    {"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},
@@ -80,7 +79,7 @@ static struct cmd_t commands[] = {
 #define MAXWIDTH       640
 #define TEXTHEIGHT     200
 
-int main(int argc, char **argv)
+static void instantiate_main(int argc, char **argv)
 { 
     struct cmd_t *cp;
 
@@ -115,20 +114,10 @@ int main(int argc, char **argv)
                                         labelWidgetClass, weapons,
                                         XtNborderWidth, 0,
                                         NULL); 
-    status   = XtVaCreateManagedWidget("status", 
-                                      boxWidgetClass, form,
-                                      XtNborderWidth, 0,
-                                      XtNfromVert, weapons, 
-                                      XtNorientation, XtorientHorizontal,
-                                      NULL); 
-    statlabel  = XtVaCreateManagedWidget("Status:       ", 
-                                        labelWidgetClass, status,
-                                        XtNborderWidth, 0,
-                                        NULL); 
     planets  = XtVaCreateManagedWidget("planets", 
                                       boxWidgetClass, form,
                                       XtNborderWidth, 0,
-                                      XtNfromVert, status, 
+                                      XtNfromVert, weapons, 
                                       XtNorientation, XtorientHorizontal,
                                       NULL); 
     planlabel  = XtVaCreateManagedWidget("Planets:      ", 
@@ -158,5 +147,10 @@ int main(int argc, char **argv)
     XtAppMainLoop(app_context);
     /* loop may be interrupted */
     XtDestroyApplicationContext(app_context);
+}
+
+int main(int argc, char **argv)
+{
+    instantiate_main(argc, argv);
     exit(0);
 }