Re: GNOME GTK-- Projects



Michael Hudson wrote:
> 
> On Mon, 1 Jun 1998, Erik Andersen wrote:
> 
> > Anyway, with something like this in place, anybody writing an application
> > (or a wrapper library) could then simply write their own error handler
> > function.   For example, Gtk-- could write an error handler that looks like:
> >
> > void GTKmm_GTK_Error_Handler(GtkErrorStruct error)
> > {
> >       throw (error);
> > }
> >
> > which will get called by gtk+ when an error occurs.   It is then very easy
> > to modify the Gtk--.m4 macro to ensure that the right thing is done by the
> > compiler WRT exceptions to ensure that this is handled.
> >
> >  -Erik
> >
> 
> Did you read my post?
> If not why did you quote it?
> Unless you compile GTK+ in C++, there's no guarantee that exceptions will
> be able to propgate through the GTK+ code.
> At the point of call of your GTKmm_GTK_Error_Handler above the stack is
> likely to look like this:
> 
> GTK_Widget::whatever
> gtk_widget_whatever          **
> _gdk_internal_gubbings       **
> GTKmm_GTK_Error_Handler
> 
> The functions marked ** will have been compiled as C, so when
> GTKmm_GTK_Error_Handler throws an exception, you can't say what's going to
> happen. What worst is this will probably work - most of the time.
> 
> This isn't to say configurable error reporting isn't a very, very good
> idea, but C and C++ don't always mix perfectly.

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--?

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()?  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?

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?

John



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