Re: GNOME GTK-- Projects



On Mon, 1 Jun 1998, John R Sheets wrote:
> Michael Hudson wrote:
> Got any ideas for an alternative?  Perhaps a C++ extension to
> whichever GTK+ configurable error reporting scheme (yet to be
> implemented), that doesn't use real exception handling (i.e. a
> hack)?  Is there any hope for being able to use exception
> handling in GTK--?

So long as you delay the thrown excpetion until you're back in GTK-- land
you should be safe, but that's going to be hard, I should think.
Perhaps an error handler that set some appropriate static flag variable,
then when gtk returns normally, gtk-- would translate that into an
exception. Don't know if that would be feasible. (Don't mention threads). 

There's always longjmp, much as it pains me to mention it.

> Does the exception _have_ to travel through the GTK+ code?  (I'm
> asking...I don't know.)  Are you saying that the error may not
> always make it to the GTKmm_GTK_Error_Handler()?

No.

>  Or that the
> thrown exception may cause problems when the catch block dips
> back into the GTK+ code?  Could you be a little more specific?

That's right.
It may be a total non-issue, I don't know nearly enough about how the C++
runtime works on unix-like systems (I do on the Mac, fat lot of good that
does).
Or it may work with some compiler/compiler version/OS/OS version
combinations and not others. That possibility is what I was trying to
hilite.
Does anybody know enough about the C++ eh mechanism to pronounce on this?
Does GTK+'s shared library-ness make it more awkward?

> And (pitching some more playing cards out) would there be any way 
> to use (abuse) GTK+'s signal-mapping framework to set up an
> error-signal?  Something like gtk_error_signal_connect()...  Is
> there anything like that in place?

Dunno... the point is you want control to get back to the code that called
the failing method, and that's tricky without exceptions (longjmp again,
basically).  

> John
> 

Michael Hudson
Jesus College
Cambridge
mwh21@cam.ac.uk





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]