Re: XForms: simple problem

Steve Lamont (spl@szechuan.ucsd.edu)
Mon, 29 Sep 97 12:31:11 PDT

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> I know this is wrong since the do_forms function is
> being executed once at a time, but how do I loop
> through and wait untill one of the FL_OBJECTs has
> changes state?? Thanks for any help and sorry for
> bothering your time with a simple problem.

You really should be using callback functions rather than the method
you're attempting to use. This will fit much better with the XForms
programming model than trying to use if statements. However, if you
find it necessary to do otherwise you could do something like

while ( 1 ) {

FL_OBJECT *obj = fl_do_forms();

if ( obj == first_object )
do_first_object_thing();
else if ( obj == second_object )
do_second_object_thing();
else if ( obj == third_object )
do_third_object_thing();

}

However, if you have many objects you'll find this becoming
cumbersome. Again, you really should look at callbacks and use them.
I believe if you look at any of the DEMOS code you should be able to
get a good understanding of how they work.

spl
_________________________________________________
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/