Re: XForms: how does fl_show_question() do it ?

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 8 Jul 98 14:42:05 PDT

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

> Sorry. You want to use fl_check_forms() or fl_check_only_forms() instead.
> That's what works for me.

I think that would create a "buzz loop."

Recall that what he wants to do is emulate the function of the
goodies, which look, somewhat schematically, like this:

int fl_some_goodie( ... )

{

FD_goodie *fd_goodie = create_form_goodie();

[...]

fl_show_form( ... );

do
obj = fl_do_forms();
while ( ( obj != fd_goodie->quit_button ) &&
( obj != fd_goodie->doit_button ) );

if ( obj == fd_goodie->doit_button )
process_the_doit();

fl_hide_form( fd_goodie->goodie );
fl_free_form( fd_goodie->goodie );
fl_free( fd_goodie );

return some_result;

}

This bogused goodie has at least two buttons -- a "quit_button" and a
"doit_button".

If you used fl_check_forms() in this case, the do-while loop would
buzz and eat the CPU since fl_check_forms() and its ilk return
immediately if there is no queued event. fl_do_forms() blocks until
an event occurs, which, in this case, is the desired behavior.

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/