Exiting

When your program is done, all it has to do is call exit(). You do not need to do any cleanup code for Fl. In particular you do not have to destroy any objects you have created. You will need to do #include <stdlib.h> to call exit().

If you don't do anything about it, FL will call exit(0) when the user tries to close the last remaining window. On an SGI machine running 4DWM, it is possible to pick "Quit" off the window menu, and FL will exit(0) in this case as well. If FL detects an error (such as being unable to open the display or an unsupported visual) it will print a message and call exit(1).

You can override these behaviors with these functions:

void Fl::set_atclose(void (*cb)(Fl_Window*, void*));

void Fl::default_atclose(Fl_Window*, void*);

void Fl::set_abort(void (*cb)(const char*,...);

void Fl::default_abort(const char*,...);

void Fl::atclose(Fl_Window*, void*);
void Fl::abort(const char*,...);