aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/find_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-05-02 08:04:31 +0000
committerGuy Harris <guy@alum.mit.edu>2000-05-02 08:04:31 +0000
commitebdbff44e84856b3847800ef9579ab078abe739e (patch)
tree1feeee8e60d5715cbea7624f3ce374e4a177c5a2 /gtk/find_dlg.c
parentf3feac3b1defe697783f220f4c430976c768c044 (diff)
Add some utilities to:
set the "activate" signal for a widget to call a routine to activate the "OK" button for a dialog box; set the "key_press_event" signal for a top-level dialog window to call a routine to activate the "Cancel" button for a dialog box if the key being pressed is the <Esc> key; to make it easier to drive dialog boxes entirely from the keyboard. Make the "Find Frame" and "Go To Frame" dialog boxes use those utilities. svn path=/trunk/; revision=1903
Diffstat (limited to 'gtk/find_dlg.c')
-rw-r--r--gtk/find_dlg.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk/find_dlg.c b/gtk/find_dlg.c
index 8f2e19da6e..577d947c10 100644
--- a/gtk/find_dlg.c
+++ b/gtk/find_dlg.c
@@ -1,7 +1,7 @@
/* find_dlg.c
* Routines for "find frame" window
*
- * $Id: find_dlg.c,v 1.8 2000/04/01 12:03:41 guy Exp $
+ * $Id: find_dlg.c,v 1.9 2000/05/02 08:04:30 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -46,6 +46,7 @@
#include "find_dlg.h"
#include "filter_prefs.h"
#include "simple_dialog.h"
+#include "dlg_utils.h"
/* Capture callback data keys */
#define E_FIND_FILT_KEY "find_filter_te"
@@ -152,6 +153,17 @@ find_frame_cb(GtkWidget *w, gpointer d)
gtk_object_set_data(GTK_OBJECT(find_frame_w), E_FIND_FILT_KEY, filter_te);
gtk_object_set_data(GTK_OBJECT(find_frame_w), E_FIND_BACKWARD_KEY, backward_rb);
+ /* Catch the "activate" signal on the frame number text entry, so that
+ if the user types Return there, we act as if the "OK" button
+ had been selected, as happens if Return is typed if some widget
+ that *doesn't* handle the Return key has the input focus. */
+ dlg_set_activate(filter_te, ok_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 "Cancel" button had
+ been selected. */
+ dlg_set_cancel(find_frame_w, cancel_bt);
+
/* Give the initial focus to the "Filter" entry box. */
gtk_widget_grab_focus(filter_te);