Re: XForms: return code 60, fl_set_input_filter

Steve Lamont (spl@szechuan.ucsd.edu)
Mon, 30 Mar 98 06:04:38 PST

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

> 1. I have a form with several single-line inputs on it. Whenever I hit
> the tab key, my program exits with return code 60. Why?

Do you have a callback routine assigned to all the Input object? If
not, then fl_do_forms() will exit, returning control to your program.
If your main looks like

int main( int argc, char **argv )

{

[...]

fl_do_forms();

}

then when an Input object (or, for that matter, any non-static object)
is triggered, in this case by hitting Tab, then fl_do_forms() returns.
This, of course, causes main() to return random junk. This is
documented behavior.

If you don't want or need to install callbacks for every object (such
as for a bunch of Inputs which are intended to be processed in one big
lump when a "do it" button is clicked), then you should code

while ( 1 )
( void ) fl_do_forms();

or

while ( fl_do_forms() )
;

This will cause your program to run forever, or at least until you
actuate a callback that causes exit() to be called.

> 2. I'm using fl_set_input_filter() on one of my inputs. The program
> reaches my validator function, and the content of the first parameter
> (the FL_OBJECT one) looks reasonable, but the other three contain
> garbage. More specifically, the second and third parameters look like
> legitimate address, but they point at garbage. The fourth parameter
> looks like an address rather than an int. Any ideas?

About the only thing I can suggest is to look at your memory
management and make sure you're not referencing pointers after they've
been freed or other such no-nos (my particular favorite is to try to
free an automatic variable -- it produces particularly bizarre results
which are often quite difficult to track down).

Other than that, no guess without seeing example code.

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/