diff options
author | RichardHitt <rbh00@netcom.com> | 2013-03-17 15:11:23 -0700 |
---|---|---|
committer | RichardHitt <rbh00@netcom.com> | 2013-03-17 15:11:23 -0700 |
commit | ecdcc99280d29994791b8bc3273bf03a670d0b7b (patch) | |
tree | 947e2145e5cf149f0ccfc4d86d77dd2f2b278943 /src/fe-gtk/rawlog.c | |
parent | e8a78b9aa1398deb69d20d599be2a630f721cafa (diff) |
ESC key will destroy the windows mentioned at issue 211.
This change implements generic routine gtkutil_destroy_on_esc () and adds invocations of it in the requisite window-handling places.
Diffstat (limited to 'src/fe-gtk/rawlog.c')
-rw-r--r-- | src/fe-gtk/rawlog.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/fe-gtk/rawlog.c b/src/fe-gtk/rawlog.c index 6764034f..651ca1ec 100644 --- a/src/fe-gtk/rawlog.c +++ b/src/fe-gtk/rawlog.c @@ -86,7 +86,7 @@ rawlog_savebutton (GtkWidget * wid, server *serv) return FALSE; } -static void +static gboolean rawlog_key_cb (GtkWidget * wid, GdkEventKey * key, gpointer userdata) { /* Copy rawlog selection to clipboard when Ctrl+Shift+C is pressed, @@ -99,13 +99,7 @@ rawlog_key_cb (GtkWidget * wid, GdkEventKey * key, gpointer userdata) { gtk_xtext_copy_selection (userdata); } - /* close_rawlog is given to mg_create_generic_tab as - * close_callback, it should take care of the rest. - */ - else if (key->keyval == GDK_Escape) - { - gtk_widget_destroy (wid); - } + return FALSE; } void @@ -124,6 +118,7 @@ open_rawlog (struct server *serv) serv->gui->rawlog_window = mg_create_generic_tab ("RawLog", tbuf, FALSE, TRUE, close_rawlog, serv, 640, 320, &vbox, serv); + gtkutil_destroy_on_esc (serv->gui->rawlog_window); hbox = gtk_hbox_new (FALSE, 2); gtk_container_add (GTK_CONTAINER (vbox), hbox); |