Re: XForms: Newbie Question

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 21 May 97 13:52:05 PDT

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

> this is a newbie question: Since fl_do_forms takes over control, how do
> I create an application, that
> also itself needs to constalty watch something? ...

Look at the fl_add_io_callback(), fl_set_idle_callback(), and
fl_add_timeout() functions.

fl_add_io_callback() allows you to "watch" a file descriptor. When
the descriptor is ready, the callback is fired and you can process the
descriptor's data as you wish.

fl_set_idle_callback() allows you to call a specified function
whenever XForms isn't doing anything else. It is designed for
processing long running computations in an incremental fashion. This
generally requires some careful (re)design of your algorithm so that
it is interruptable. The incremental processing should only be
allowed to go on for small fractions of a second so as not to block
user interaction.

Finally, fl_add_timeout() allows you to set one or more timers which
fire at or about specified intervals (I say "about" because the timing
is not expecially precise). This allows you to do tasks at periodic
intervals.

There is also a signal handling callback (see
fl_add_signal_callback()).

Refer to the manual for details.

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/