I want to prevent Fl_Window from being closed by button escape [Esc].

I found window is closing because of Fl::Fl::handle_():

     // make Escape key close windows:
     if (event_key()==FL_Escape) {
       wi = modal(); if (!wi) wi = window;
       wi->do_callback();
       return 1;
     }

Should I rebuild FLTK without this, or is there a way to deactivate?

Writing a callback like

void Cb_Close(Fl_Widget* o, void* v)
{
        if (Fl::event_key()!= FL_Escape)        Test.hide();
        else Fl::event_key(0);  // No effect!

}

leaves the problem, that window doesn't close by mouse, when Escape was 
pressed before.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to