aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/simple_dialog.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-05-03 07:19:38 +0000
committerGuy Harris <guy@alum.mit.edu>2000-05-03 07:19:38 +0000
commit2d51ff4e4f1322f91ae30040e0e9f391e9f9c5e6 (patch)
tree871909fdd3745cb22287029da8eaea603d202c7d /gtk/simple_dialog.c
parent4509614da19c09415636c56b3fa20c743eea4cd0 (diff)
downloadwireshark-2d51ff4e4f1322f91ae30040e0e9f391e9f9c5e6.tar.gz
wireshark-2d51ff4e4f1322f91ae30040e0e9f391e9f9c5e6.tar.bz2
wireshark-2d51ff4e4f1322f91ae30040e0e9f391e9f9c5e6.zip
Make dialog boxes created with "simple_dialog()" use the new utilities
to make the Esc key cancel the dialog box (or accept it, if it has no "Cancel" button). svn path=/trunk/; revision=1905
Diffstat (limited to 'gtk/simple_dialog.c')
-rw-r--r--gtk/simple_dialog.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk/simple_dialog.c b/gtk/simple_dialog.c
index 1cb19175fc..71603e0f62 100644
--- a/gtk/simple_dialog.c
+++ b/gtk/simple_dialog.c
@@ -1,7 +1,7 @@
/* dialog.c
* Dialog box routines.
*
- * $Id: simple_dialog.c,v 1.1 2000/01/03 06:59:25 guy Exp $
+ * $Id: simple_dialog.c,v 1.2 2000/05/03 07:19:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -45,6 +45,7 @@
#include "gtkglobals.h"
#include "simple_dialog.h"
+#include "dlg_utils.h"
#include "image/icon-excl.xpm"
#include "image/icon-ethereal.xpm"
@@ -151,6 +152,16 @@ simple_dialog(gint type, gint *btn_mask, gchar *msg_format, ...) {
gtk_container_add(GTK_CONTAINER(bbox), cancel_btn);
GTK_WIDGET_SET_FLAGS(cancel_btn, GTK_CAN_DEFAULT);
gtk_widget_show(cancel_btn);
+
+ /* Catch the "key_press_event" signal in the window, so that we can catch
+ the ESC key being pressed and act as if the "Cancel" button had
+ been selected. */
+ dlg_set_cancel(win, cancel_btn);
+ } else {
+ /* Catch the "key_press_event" signal in the window, so that we can catch
+ the ESC key being pressed and act as if the "OK" button had
+ been selected. */
+ dlg_set_cancel(win, ok_btn);
}
if (btn_mask)