debian: Fix maintainer email address.
[xtoys] / xcatch.c
index 4f99d19..6ddb4ea 100644 (file)
--- a/xcatch.c
+++ b/xcatch.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: xcatch.c,v 1.8 1999/06/19 23:42:55 mdw Exp $
+ * $Id: xcatch.c,v 1.10 2004/04/08 01:36:29 mdw Exp $
  *
  * Catch input and trap it in an X window
  *
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: xcatch.c,v $
- * Revision 1.8  1999/06/19 23:42:55  mdw
- * Improve signal handling.  Fix options parsing to POSIX order only.
- *
- * Revision 1.7  1999/05/21 22:09:19  mdw
- * Take advantage of new dynamic string macros.
- *
- * Revision 1.6  1999/05/19 20:41:15  mdw
- * Track gratuitous change in mdwopt interface.
- *
- * Revision 1.5  1999/05/05 18:55:18  mdw
- * Block SIGCHLD around the `fork' call to prevent a race.
- *
- * Revision 1.4  1999/03/24 22:23:57  mdw
- * Improve display for large files.  Keep newly added material in view if
- * scrolled to bottom of window.
- *
- * Revision 1.3  1998/12/20 17:19:16  mdw
- * Return exit status of child process, rather than always returning
- * success.
- *
- * Revision 1.2  1998/12/16 00:10:58  mdw
- * Fix tabbing in help text.
- *
- * Revision 1.1  1998/12/15 23:46:50  mdw
- * New program: captures input and puts it in a window.
- *
- */
-
 /*----- Header files ------------------------------------------------------*/
 
 #include <errno.h>
 
 static unsigned int flags;
 
-enum {
-  f_closed = 1,
-  f_bogus = 2
-};
+#define f_closed 1u
+#define f_bogus 2u
 
 static GtkWidget *textbox = 0;
 static GdkFont *font;
@@ -114,8 +81,8 @@ static void ready(gpointer data, gint fd, GdkInputCondition c)
 {
   char buf[1024];
   int doscroll = 1;
-  GtkText *t;
-  GtkAdjustment *va;
+  GtkText *t = 0;
+  GtkAdjustment *va = 0;
 
   /* --- If not ready to read then go away --- */
 
@@ -150,7 +117,7 @@ static void ready(gpointer data, gint fd, GdkInputCondition c)
     if (r < 0) {
       if (errno == EWOULDBLOCK)
        break;
-      msg(":~OK", "error reading data: %s", strerror(errno));
+      msg(QUIS, ":~OK", "error reading data: %s", strerror(errno));
       exit(EXIT_FAILURE);
     }
 
@@ -177,12 +144,13 @@ static void ready(gpointer data, gint fd, GdkInputCondition c)
       GtkWidget *w;
 
       win = gtk_dialog_new();
+      gtk_window_set_policy(GTK_WINDOW(win), 1, 1, 0);
       gtk_signal_connect(GTK_OBJECT(win), "destroy",
                         GTK_SIGNAL_FUNC(killwin), 0);
 
       tbl = gtk_table_new(2, 2, 0);
       gtk_container_border_width(GTK_CONTAINER(tbl), 8);
-      gtk_box_pack_start(GTK_BOX(GTK_DIALOG(win)->vbox), tbl, 1, 1, 0);
+      gtk_box_pack_start(GTK_BOX(GTK_DIALOG(win)->vbox), tbl, 1, 1, 1);
       gtk_widget_show(tbl);
 
       textbox = gtk_text_new(0, 0);