From d96eb452ac208e1548ab35641b2ae496b2bb4220 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 3 May 2000 07:44:12 +0000 Subject: 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 --- gtk/summary_dlg.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'gtk/summary_dlg.c') 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 @@ -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); -- cgit v1.2.3