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

Steve Lamont (spl@szechuan.ucsd.edu)
Tue, 7 Jul 98 10:26:08 PDT

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

> I need to write something similar to fl_show_question(), in that it
> will display a new form, allow interaction with it (and possibly, or
> possibly not other forms, but thats incidental) and return a value to
> the caller.
>
> Its completely unclear to me how to do this. Once my routine calls
> fl_show_form(), what can it do to allow interaction to proceed ?

fl_show_question() uses the return value of fl_do_forms() to determine
what button was pushed. For example, schematically,

FD_some_form *fd_some_form = create_form_some_form();
FL_OBJECT *obj;

[... whatever setup you need to do ...]

fl_deactivate_all_forms(); /* if you want to shut all others off */

fl_show_form( fd_some_form->some_form, ... );

do
obj = fl_do_forms();
while ( ( obj != fd_some_form->yes ) &&
( obj != fd_some_form->no ) );

if ( obj == fd_some_form->no )
do_your_no_thing();
else
do_your_yes_thing();

fl_hide_form( fd_some_form->some_form );
fl_free_form( fd_some_form->some_form );
fl_free( fd_some_form );

[...]

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/