From 8da62b87bff2d7f3f41f68fc91c2321f7b1485d6 Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Thu, 16 May 2013 18:03:58 +0100 Subject: [PATCH] -ESC key doesn't close GUI anymore --- src/gui.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui.cxx b/src/gui.cxx index 3b613ac..5062165 100644 --- a/src/gui.cxx +++ b/src/gui.cxx @@ -10,6 +10,12 @@ int GMasterTrack::privateID = 0; using namespace std; +void close_cb(Fl_Widget*o, void*) { + if ((Fl::event() == FL_KEYDOWN || Fl::event() == FL_SHORTCUT) + && Fl::event_key() == FL_Escape) + return; // ignore ESC + else o->hide(); +} static void gui_static_read_rb(void* inst) { @@ -23,6 +29,7 @@ Gui::Gui() : { window.color(FL_BLACK); window.label("Luppp 5"); + window.callback( close_cb, 0 ); Avtk::Image* header = new Avtk::Image(0,0,600,36,"header.png");