Re: XForms: Global data

Jacques Tremblay (jackt@gel.ulaval.ca)
Fri, 13 Mar 1998 09:48:57 -0500 (EST)

# To subscribers of the xforms list from Jacques Tremblay <jackt@gel.ulaval.ca> :

On Fri, 13 Mar 1998, Ian Leonard wrote:

.: Date: Fri, 13 Mar 1998 08:03:33 +0000 (GMT)
.: From: Ian Leonard <ian@eonsw.demon.co.uk>
.: Reply-To: xforms@bob.usuf2.usuhs.mil
.: To: xforms@bob.usuf2.usuhs.mil
.: Subject: Re: XForms: Global data
.:
.: When you call
.:
.: fl_set_object_callback ( objs, base_callback, (long) this);
.:
.:
.: you pass the "this" pointer. The xforms callback functions converts this to
.: the base type class and calls callback in the base class. This is dynamical
.: bound to your button class. Clear?
.:

Hi,

This works on systems that have longs the same size as pointers.
This has been discussed in the list some times ago. Suppose the pointers
are 64 bits and the long 32 bits, it will crash. I think the best
place to keep the this pointer is in the u_vdata structure element of
the object because its a pointer. This makes code work on any system.
I made an example of using XForms and C++. You can look at it in the
Contrib directory of the xforms ftp.

Have a nice day

Jacques Tremblay

***************************************************************************
* Jacques Tremblay * jackt@gel.ulaval.ca *
* Dept. Genie Electrique * *
* Universite Laval * *
* Quebec * *
***************************************************************************

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/