projects
/
clawsker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d2b9c23
)
Allow to exit with escape key
author
Ricardo Mones
<ricardo@mones.org>
Sat, 14 Jul 2018 10:56:00 +0000
(12:56 +0200)
committer
Ricardo Mones
<ricardo@mones.org>
Sat, 14 Jul 2018 10:56:00 +0000
(12:56 +0200)
clawsker
patch
|
blob
|
history
diff --git
a/clawsker
b/clawsker
index b286a67236248cc9821d58e8a94ba8a58fd3379b..8c8b6875c728228eb221de126fad831dadacd483 100755
(executable)
--- a/
clawsker
+++ b/
clawsker
@@
-2822,6
+2822,13
@@
sub get_app_icons {
return @APPICONS;
}
return @APPICONS;
}
+sub escape_key_handler {
+ my ($widget, $event) = @_;
+ if ($event->keyval == Gtk2::Gdk->keyval_from_name('Escape')) {
+ exit_handler($widget);
+ }
+}
+
# initialise
exit unless parse_command_line ();
Gtk2->init;
# initialise
exit unless parse_command_line ();
Gtk2->init;
@@
-2835,6
+2842,7
@@
my $about = new_about_dialog ();
$box->pack_start (new_notebook (), TRUE, TRUE, 0);
$box->pack_end (new_button_box ($main_window, $about), FALSE, FALSE, 0);
$main_window->signal_connect (delete_event => sub { exit_handler($main_window) });
$box->pack_start (new_notebook (), TRUE, TRUE, 0);
$box->pack_end (new_button_box ($main_window, $about), FALSE, FALSE, 0);
$main_window->signal_connect (delete_event => sub { exit_handler($main_window) });
+$main_window->signal_connect (key_press_event => \&escape_key_handler);
$main_window->set_title ($xl::s{win_title});
$main_window->set_icon_list (get_app_icons ());
$main_window->add ($box);
$main_window->set_title ($xl::s{win_title});
$main_window->set_icon_list (get_app_icons ());
$main_window->add ($box);