XForms: Deactivating forms

Ivan Powis (pczip@chemistry.nottingham.ac.uk)
Tue, 24 Jun 1997 16:48:28 BST

To subscribers of the xforms list from Ivan Powis <pczip@chemistry.nottingham.ac.uk> :

I am a little confused about the operation of fl_deactivate(form).

I am developing an application which (at present) has a single
displayed form. After interaction with the form there is a 'GO'
button to invoke a fairly lengthy procedure. Ultimately this will
also put up a form to allow interactive examination of its results,
but for now it just runs for about 20 secs then returns control to the
original form. Below is my 'GO' button callback. It sets a watch
cursor on the original form then deactivates the form, calls my
processing subroutine krunch, and then resets things when krunch
returns, before exiting.

However, if I press a button on the supposedly deactivated form, its
callback still gets called when krunch and then go_cb return. In other
words the interaction seems to be delayed, but not prevented. In fact
this is precisely the behaviour I see without the deactivate/activate
calls - ie there is a temporary blocking of interaction with
the form while krunch executes, but any interaction gets queued up till
the 'GO' callback has finished.

So how should I cause my form to actually IGNORE any interaction during
the 'GO' callback, rather than just deferring its response till after
go_cb completes?

Is it not a good idea to put a lengthy procedure in a callback?

void go_cb(FL_OBJECT *ob, long data)
{
char buff[100];
int i;
FL_FORM *f;
FD_p3gui *frm;
FL_OBJECT *brwsr;

f = ob->form;
[ ... some stuff logged to a browser .... ]
fl_set_cursor(f->window,XC_watch);
XSync(fl_get_display(),0);
fl_deactivate_form(f);
krunch();
fl_activate_form(f);
fl_reset_cursor(f->window);
}

FORMS Library Beta 0.86.1 of 1997/04/18 06:04:08 N
HP-UX A.09.03

Ivan

--
-------------------------------------------------------------------------+
    ___  ___/   _  __ /  Ivan Powis                TEL: +44-115-951-3467 |
        /         /   /  Department of Chemistry   FAX: +44-115-951-3562 |
       /         /  _/   University of Nottingham                        |
      /         ___/     Nottingham NG7 2RD                              |
     /         /         UK                                              |
    /         /                      pczip@chem.nott.ac.uk               | 
_______/  ____/                      http://www.chem.nott.ac.uk/IP.html  |
-------------------------------------------------------------------------+

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