XForms: Data casting to callbacks

Alain Muls (alain@asge-009.rma.ac.be)
Wed, 9 Jul 1997 15:57:15 +0200

To subscribers of the xforms list from Alain Muls <alain@asge-009.rma.ac.be> :



I am writing a program that controls the configuration of a network of
GPS stations. The configuration parameters are groupes in 3 structures
(e.g. str1, str2 & str3). In order to write the structure members to
the configuration file, I have a `save as' button with a callback
`cbSaveAs'. The problem is that I can only cast 1 structure to a long
and pass it to the callback function. How can I access all 3
structures in the callback.

I have a solution, but I do not found it very elegant. What I do is
create a structure str4 which groups all 3 other structures
typedef struct
str1 a;
str2 b;
str3 c;
} str4
and I pass this structure through the (long) casting to the
callback. Is there a better way?


I also have a button `load configuration'. An additional problem is
that when I load another configuration file, how do I update all the
fields from the callback `cbLoad' function?


Alain Muls tel +32/2/737.61.20
Royal Military Academy fax +32/2/737.60.47 ASGE
Renaissanceavenue 30 e-mail Alain.Muls@asge.rma.ac.be
B-1000 Brussels e-mail alain@asge-004.rma.ac.be
BELGIUM ICBM 50d50,6669'N 4d23.5299'E
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/