aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/supported_protos_dlg.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2003-11-28 00:13:08 +0000
committerUlf Lamping <ulf.lamping@web.de>2003-11-28 00:13:08 +0000
commitcd01ca6cb034c64b07e0d7915b5b5e4a7f2da1d1 (patch)
tree749c0360e125fd667be06d52ebedce170e2891f2 /gtk/supported_protos_dlg.c
parent131eeab31d85afbef5558f123a6d7422e7b2d7e3 (diff)
using dlg_utils.c functions to catch the ESC key to close the dialog
svn path=/trunk/; revision=9110
Diffstat (limited to 'gtk/supported_protos_dlg.c')
-rw-r--r--gtk/supported_protos_dlg.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk/supported_protos_dlg.c b/gtk/supported_protos_dlg.c
index ab9aef6283..c6e6462120 100644
--- a/gtk/supported_protos_dlg.c
+++ b/gtk/supported_protos_dlg.c
@@ -38,6 +38,7 @@
#include "gtkglobals.h"
#include "ui_util.h"
#include "compat_macros.h"
+#include "dlg_utils.h"
@@ -93,15 +94,8 @@ void supported_cb(GtkWidget *w _U_, gpointer data _U_)
return;
}
-#if GTK_MAJOR_VERSION < 2
- supported_w = gtk_window_new(GTK_WINDOW_DIALOG);
-#else
- supported_w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-#endif
- gtk_widget_set_name(supported_w, "Ethereal Supported Protocols window" );
- gtk_window_set_title(GTK_WINDOW(supported_w), "Ethereal: Supported Protocols");
+ supported_w = dlg_window_new("Ethereal: Supported Protocols");
SIGNAL_CONNECT(supported_w, "destroy", supported_destroy_cb, NULL);
- SIGNAL_CONNECT(supported_w, "realize", window_icon_realize_cb, NULL);
WIDGET_SET_SIZE(supported_w, DEF_WIDTH * 2/3, DEF_HEIGHT * 2/3);
gtk_container_border_width(GTK_CONTAINER(supported_w), 2);
@@ -242,6 +236,12 @@ void supported_cb(GtkWidget *w _U_, gpointer data _U_)
gtk_widget_show(close_bt);
gtk_quit_add_destroy(gtk_main_level(), GTK_OBJECT(supported_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(supported_w, close_bt);
+
gtk_widget_show(supported_w);
} /* supported_cb */