[comp.windows.x] Calling a C++ routine as an X11 libXt callback function

vanandel@stout.atd.ucar.edu (Joe Van Andel) (08/21/90)

I am writing an application that uses the Athena widget set, but I would like 
to write this application in C++ (using g++),  if possible.  
(Yes, I know about the Interviews toolkit, but it doesn't have the ease of use
of the Widget Creation Language toolkit, nor does it let a user tailor 
an application by using X11 resources.  Solbourne's OI also looks interesting,
but I can't afford to pay AT&T $10000 + just now.)

I've heard rumors of some University writing a C++ binding for Motif, that 
will be released with X11 at some future date.  Does anyone know when this 
might be available?  Does this toolkit allow access to the Xt resource 
database?

The biggest hassle I see with using C++ and a non C++ toolkit is that
of using callbacks.  Since the callbacks are designed to be C
functions, how can I possibly invoke C++ functions, particularly if I
want to invoke the method of a given object?   If I have to, I'll write a bit 
of "glue" in "C", but I don't know how to do it.  Obviously, if writing the 
glue is too tedious or difficult, using C++ just may not be worth the hassle.

Surely, someone has solved the problem of calling a C++ function as a 
callback function!

Does anyone have any other suggestions about how to program X11 applications,
have access to the functionality of libXt, and still use C++ ?

Thanks much.  Please mail me responses, and I'll summarize the results. 

--
	Joe VanAndel  		Internet:vanandel@ncar.ucar.edu
	NCAR - RSG  			
	P.O Box 3000		Fax:	 303-497-2044
	Boulder, CO 80307-3000	Voice:	 303-497-2071