RE: GNOME GTK-- Projects




John R. Sheets wrote:

	>That's kind of what I was thinking...if the GTK+ function chokes,
	>it sets a flag or calls some error signal callback, then dies. 
	>The C++ wrapper acknowledges the error and throws an exception or
	>pursues some alternate tactic (e.g. I dunno...maybe it changes a
	>property and tries the same operation again.). 

	>The problem with this is that every time you access a GTK+
	>function, you have to check the error flag.  This kinda runs
	>counter to the intent of exceptions being more passive, more
	>event-driven.  The longjmp may be a performance hit, but even
	>more so will be this constant error polling.

	>Kind of a sticky situation.  No easy answers.

If GTK+ had a callback for error handling, a GTK-- program 
could register a callback that checks the error type and
throws the right GTK-- exception and a GTK+ based program 
would register its own error handling code.  The GTK+ 
behavior could also be the default for GTK-- compiled w/o 
aedquate compiler support for exceptions... Does that 
sound feasible?

----------------------------------------------------------------------------
Alan Chen
Aerospace Engineer -- Systems and Simulation
Manipulating reality on a daily basis, consultations available..



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