On 25.10.2011 17:53, Greg Ercolano wrote:
> On 10/25/11 01:52, chris wrote:
>>> I could swear back in ye olde docs when I first started
>>> learning FLTK, this was a FAQ item that was covered clearly.
>>
>> Do you perhaps refer to this?
>>
>> http://www.fltk.org/articles.php?L378+I0+T+M10+P1+Qescape
>
> That's certainly the solution (which is included in my r9146 checkin),
> but I was thinking it was actually /in/ the early FLTK docs.
>
> I have a hazy memory of a little FAQ list, with the Esc key issue
> being high in the list. Perhaps it was in one of the very early
> README files.
BTW, here is another (maybe better, because shorter ?) solution:
void close_cb(Fl_Widget *w, void *) {
if (Fl::event() == FL_CLOSE) w->hide();
}
In FLTK 1.1 the hide() call (the widget pointer) would need to be
cast to (Fl_Window *):
((Fl_Window *)w)->hide();
because hide() it not virtual in FLTK 1.1.
As shown before, pressing ESC generates FL_SHORTCUT events (or
FL_KEYBOARD, but the latter is usually not delivered to Fl_Window).
Clicking on the window's close button sends an FL_CLOSE event
instead.
Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk