Unfortunately you didn't write how you established (registered) this
"handler". Its signature looks like a callback
of a widget. Since you are using `delete w` I assume that it's
established like:
cw->callback(OnMainWindowEvent, ...);
Hence this would call the callback when the window is closed by its
close button. There's no need to check for the recent event by
calling `Fl::event();` - did you ever see the output of `"Main
window event: " << ev << ...` ?
However, a callback would be a `void` function, i.e. it would return
nothing. There are other real handler() methods which are called
from event handling that must return 0 or 1, depending on whether
you used (consumed) the event. But these can only be defined if you
subclass another widget class.
Last but not least, this handler would delete the window object,
which is - as Ian and I said - not necessary, but it doesn't remove
your directory, does it?
I am happy to read the many more options you have listed;
and to note the reactivity of the forum.
So many more subtleties to discover yet.
Thank you all and regards.
Welcome. There is indeed much more to discover. If you want to learn
more about FLTK, reading the first chapters of the documentation,
which are kinda tutorials, is strongly recommended. There are also a
lot of test and example programs bundled with the FLTK library in
these folders:
/examples/ : these attempt to provide short programs with good
coding practices to new users
/test/ : all kinds of test and demo programs to test the FLTK
library itself. The code in these programs works but may not be
the recommended practice for user programs. It's a valuable
resource for learning FLTK though.
Comments are owned by the poster. All other content is copyright 1998-2026 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.