On 21.08.2011, at 04:23, Bill Spitzak wrote:

> My recommendation (somewhat done in fltk 2.0) is that fltk NEVER throws 
> exceptions, and NEVER catches them.
> 
> However it is allowed that callbacks throw exceptions. These should work 
> and should cleanly return to the user code that catches the exception, 
> and it can re-run fltk without a crash. For instance if you should be 
> able to write:
> 
>   main() {
>     for (;;) {
>       try {
>         fltk::run();
>         exit(0);
>       } catch (...) {
>         // exceptions thrown by callbacks are here!
>         // however fltk::run() can be called right afterwards
>       }
>     }
>   }
> 
> This would be a lot better than Qt.

In FLTK1, we can now set a vector to a function that is called *after* the OS 
specific event management, but *before* handling of the event by FLTK widgets. 
This makes it possible for he user to set the "catch" before the exception 
unravels the OS' event handling. The FLTK3 API is:

  typedef int (*EventDispatch)(int event, fltk3::Window *w);

  void event_dispatch(fltk3::EventDispatch d);
  fltk3::EventDispatch event_dispatch();

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to