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.
This commit is contained in:
RichardHitt
2013-03-17 15:11:23 -07:00
parent e8a78b9aa1
commit ecdcc99280
10 changed files with 28 additions and 19 deletions

View File

@@ -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);