From 442600d1f7e11156bb8a205a2f043611fd178397 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 8 Apr 2009 11:00:09 +0200 Subject: use quit_cb instead of dummy_cb --- src/gipfel.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 1e038d2..cd4da09 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -129,12 +129,11 @@ void set_values() { } void quit_cb() { + if (Fl::event() == FL_SHORTCUT && Fl::event_key() == FL_Escape) + return; // ignore Escape exit(0); } -void dummy_cb() { -} - void open_cb() { char *file = fl_file_chooser("Open File?", "*.jpg", img_file); if (file) { @@ -620,10 +619,10 @@ int main(int argc, char** argv) { Fl::scheme("plastic"); control_win = create_control_window(); - control_win->callback((Fl_Callback*) dummy_cb); + control_win->callback((Fl_Callback*) quit_cb); view_win = new Fl_Window(800, 600); - view_win->callback((Fl_Callback*) dummy_cb); + view_win->callback((Fl_Callback*) quit_cb); // The Fl_Group is used to avoid FL_DAMAGE_ALL in Fl_Scroll::position Fl_Group *g = new Fl_Group(0, 0, view_win->w(), view_win->h()); -- cgit v1.2.3