Re: XForms: XForms update Form

Steve Lamont (spl@szechuan.ucsd.edu)
Mon, 24 Aug 98 15:03:20 PDT

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

> I am trying to create a program that updates a label with some text, as
> certian events occur. The program was a command line, that I am
> converting. It would print something to the terminal window, as it
> completed certian steps. I am trying to do the same thing but to a
> Label. The last step is output, but the ones before it are not.
>
> Am I correct in thinking that there is a function to update the form -
> re paint it as the stemps try to output their message. ...

Are you handing control back to XForms after you update the text? If
not, then only the last change will indeed show up since
fl_set_object_label() just sets a parameter in the object's data
structure.

If you want to show status while doing some task that normally blocks
XForms, you need to call fl_check_forms() to flush your changes. To
show a rather silly example:

while ( 1 ) {

char buffer[80];

sprintf( buffer, "iteration %d", i++ );
fl_set_object_label( fd_try->text, buffer );

fl_check_forms();

sleep( 1 );

}

The code above will update the iteration counter roughly once per
second.

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/