Set focus on the entry field, rather than leaving things to luck.
[xtoys] / xshutdown.c
index d65a9bd..f76dc39 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: xshutdown.c,v 1.2 1998/11/21 22:30:23 mdw Exp $
+ * $Id: xshutdown.c,v 1.4 1998/12/03 00:39:45 mdw Exp $
  *
  * Pretty GTK interface to waking up an xwait
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: xshutdown.c,v $
+ * Revision 1.4  1998/12/03 00:39:45  mdw
+ * Force focus when starting up.
+ *
+ * Revision 1.3  1998/11/30 22:36:49  mdw
+ * Tidy up tabbing in help texts very slightly.
+ *
  * Revision 1.2  1998/11/21 22:30:23  mdw
  * Support GNU-style long options throughout, and introduce proper help
  * text to all programs.  Update manual pages to match.
@@ -50,6 +56,7 @@
 #include <gtk/gtk.h>
 #include <gdk/gdkprivate.h>
 
+#include "mdwfocus.h"
 #include "mdwopt.h"
 #include "quis.h"
 #include "xwait.h"
@@ -148,7 +155,7 @@ int main(int argc, char *argv[])
 "-u, --usage           Display a short usage summary\n"
 "-v, --version         Display the program's version number\n"
 "\n"
-"-a, --atom=ATOM               Select the atom that `xwait' is waiting for\n"
+"-a, --atom=ATOM\t     Select the atom that `xwait' is waiting for\n"
 "-m, --msg=MSG         Select the message to send to `xwait'\n"
 "-p, --prompt=PROMPT   Select the prompt string in the confirmation box\n"
 "-t, --title=TITLE     Select the title string in the confirmation box\n",
@@ -226,6 +233,8 @@ int main(int argc, char *argv[])
 
       /* --- Make everything work --- */
 
+      gtk_widget_realize(win);
+      mdwfocus(win);
       gtk_widget_show(win);
       gtk_main();
       exit(EXIT_FAILURE);
@@ -273,6 +282,8 @@ int main(int argc, char *argv[])
 
     /* --- Show the completed window --- */
 
+    gtk_widget_realize(win);
+    mdwfocus(win);
     gtk_widget_show(win);
   }