diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-05-02 08:04:31 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-05-02 08:04:31 +0000 |
commit | ebdbff44e84856b3847800ef9579ab078abe739e (patch) | |
tree | 1feeee8e60d5715cbea7624f3ce374e4a177c5a2 /gtk/goto_dlg.c | |
parent | f3feac3b1defe697783f220f4c430976c768c044 (diff) | |
download | wireshark-ebdbff44e84856b3847800ef9579ab078abe739e.tar.gz wireshark-ebdbff44e84856b3847800ef9579ab078abe739e.tar.bz2 wireshark-ebdbff44e84856b3847800ef9579ab078abe739e.zip |
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/goto_dlg.c')
-rw-r--r-- | gtk/goto_dlg.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk/goto_dlg.c b/gtk/goto_dlg.c index dae142c4e3..9062a26dd6 100644 --- a/gtk/goto_dlg.c +++ b/gtk/goto_dlg.c @@ -1,7 +1,7 @@ /* goto_dlg.c * Routines for "go to frame" window * - * $Id: goto_dlg.c,v 1.5 2000/03/15 08:54:24 guy Exp $ + * $Id: goto_dlg.c,v 1.6 2000/05/02 08:04:31 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -47,6 +47,7 @@ #include "goto_dlg.h" #include "prefs_dlg.h" #include "simple_dialog.h" +#include "dlg_utils.h" /* Capture callback data keys */ #define E_GOTO_FNUMBER_KEY "goto_fnumber_te" @@ -110,6 +111,17 @@ goto_frame_cb(GtkWidget *w, gpointer d) /* Attach pointers to needed widgets to the capture prefs window/object */ gtk_object_set_data(GTK_OBJECT(goto_frame_w), E_GOTO_FNUMBER_KEY, fnumber_te); + /* 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(fnumber_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(goto_frame_w, cancel_bt); + /* Give the initial focus to the "Frame number" entry box. */ gtk_widget_grab_focus(fnumber_te); |