aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/file_dlg.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/file_dlg.c')
-rw-r--r--gtk/file_dlg.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c
index 9e5242ce07..0af3a7b7a5 100644
--- a/gtk/file_dlg.c
+++ b/gtk/file_dlg.c
@@ -1,7 +1,7 @@
/* file_dlg.c
* Dialog boxes for handling files
*
- * $Id: file_dlg.c,v 1.22 2000/04/10 18:40:13 guy Exp $
+ * $Id: file_dlg.c,v 1.23 2000/05/08 07:13:40 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -60,6 +60,7 @@
#endif
#include "file_dlg.h"
+#include "dlg_utils.h"
#ifndef __UTIL_H__
#include "util.h"
@@ -142,6 +143,11 @@ file_open_cmd_cb(GtkWidget *w, gpointer data) {
(file_open_w)->cancel_button), "clicked", (GtkSignalFunc)
gtk_widget_destroy, GTK_OBJECT (file_open_w));
+ /* 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(file_open_w, GTK_FILE_SELECTION(file_open_w)->cancel_button);
+
gtk_widget_show(file_open_w);
}
@@ -420,6 +426,11 @@ file_save_as_cmd_cb(GtkWidget *w, gpointer data)
(file_save_as_w)->cancel_button), "clicked", (GtkSignalFunc)
gtk_widget_destroy, GTK_OBJECT (file_save_as_w));
+ /* 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(file_save_as_w, GTK_FILE_SELECTION(file_save_as_w)->cancel_button);
+
gtk_file_selection_set_filename(GTK_FILE_SELECTION(file_save_as_w), "");
gtk_widget_show(file_save_as_w);
}