RE: [gtkmm] The correct way to use Glib::Error?



> From: Dale Wiles [mailto:dwiles buffalo veridian com] 
>   I assumed that because exceptions can cause trouble, then a 
> safer way would be to use Glib::Error as a paramater to the 
> function calls similar to the way you would use GError in 
> plain old (C based) GTK.

No, Glib::Errors are exceptions:
http://www.gtkmm.org/gtkmm2/docs/reference/html/classGlib_1_1Error.html
And we throw them from gtkmm methods ourselves.

>   The argument against that is that GError has lots of 
> helpful support functions such as g_propagate_error() and I 
> don't see the equivalent in Glib::Error.

See above.

>   The long and short of it is: What's the "correct" way (if 
> there is one) to propagate my error messages so as to not 
> harrass GTKMM. I'm fine with C++ exceptions, or the GTKMM 
> equivalent of GError, GError itself, or whatever is safe.
> 
>   I just don't want to commit to one method and then find out 
> I've re-invented the wheel or riddled my application with 
> GTKMM incompatibilities.

I think you should throw exceptions and be happy.



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