Domingo Alvarez Duarte wrote:
> I want to have a popup menu comes up through the menu key on the keyboard  
> "Fl_Menu", I managed to do that but the problem is if I want to close the  
> popup menu without select any entry, using the escape key the whole window  
> closes, but I expect only the popup menu to be closed.
> 
> I'm missing something here ?

        To disable the default "Esc key closes window" behavior,
        setup a callback() for the window that does the following:

void YourWindow_Callback(Fl_Widget *w, void*) {
  if ( Fl::event_key() == FL_Escape ) return; // ignore Escape
  w->hide(); // hide window (can also call exit(0) or _exit(0))
}

        Seems like there was a FAQ item in Bill's documentation manual
        that covered this (I think it's a holdover from forms/xforms)
        but I can't find it now. Anyway that, or something like it should work.
        
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to