aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/summary_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-05-03 07:44:12 +0000
committerGuy Harris <guy@alum.mit.edu>2000-05-03 07:44:12 +0000
commitd96eb452ac208e1548ab35641b2ae496b2bb4220 (patch)
treebe0027d3eac989493f648afcfe0d2ec0a6348e44 /gtk/summary_dlg.c
parent2d51ff4e4f1322f91ae30040e0e9f391e9f9c5e6 (diff)
Make the summary dialog box use the new utilities to make the Return
and Esc keys close the dialog box; to make the Return key work, we have to make the "Close" button the default widget. svn path=/trunk/; revision=1906
Diffstat (limited to 'gtk/summary_dlg.c')
-rw-r--r--gtk/summary_dlg.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk/summary_dlg.c b/gtk/summary_dlg.c
index d3db39e519..91907341c9 100644
--- a/gtk/summary_dlg.c
+++ b/gtk/summary_dlg.c
@@ -1,7 +1,7 @@
/* summary_dlg.c
* Routines for capture file summary window
*
- * $Id: summary_dlg.c,v 1.3 2000/04/13 09:17:09 guy Exp $
+ * $Id: summary_dlg.c,v 1.4 2000/05/03 07:44:12 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -45,6 +45,7 @@
#include "summary.h"
#include "summary_dlg.h"
+#include "dlg_utils.h"
#define SUM_STR_MAX 1024
@@ -196,8 +197,15 @@ summary_open_cb(GtkWidget *w, gpointer d)
gtk_signal_connect_object(GTK_OBJECT(close_bt), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
GTK_OBJECT(sum_open_w));
+ GTK_WIDGET_SET_FLAGS(close_bt, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(main_vb), close_bt, FALSE,FALSE, 0);
- gtk_widget_show( close_bt );
+ gtk_widget_grab_default(close_bt);
+ gtk_widget_show(close_bt);
+
+ /* Catch the "key_press_event" signal in the window, so that we can catch
+ the ESC key being pressed and act as if the "Close" button had
+ been selected. */
+ dlg_set_cancel(sum_open_w, close_bt);
gtk_window_set_position(GTK_WINDOW(sum_open_w), GTK_WIN_POS_MOUSE);
gtk_widget_show(sum_open_w);