Re: XForms: Choice of drawing area and update

Steve Lamont (spl@szechuan.ucsd.edu)
Thu, 11 Sep 97 14:07:58 PDT

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

> I am developing an application which will have a drawing area where
> simple objects (pixmaps, text boxes, etc.) will move in response to
> reading a new position (x, y) for the object from a file. The position
> update will occur at a set rate (e.g. once a sec) and all objects on the
> drawing area will be moved according to the new positions read for them.

If all the objects are true XForms objects, then you might want to
create a Box or Frame object and then programatically create and
manage the objects within that region. Since the update interval is
fairly long, you could probably just use a double buffered form or use
fl_freeze_form() while you make your changes then call
fl_unfreeze_form() when you're done.

> I was wondering two things: what is the best thing to use for the
> drawing area and what would be the best method of performing the
> position update. It seems to me that a FL_CONTINUOUS_FREE free object
> might be used for the drawing area with a handler to update on the
> FL_STEP event.

That's possible, too, but...

> Or should I use an idle callback or a timeout? ...

You can set the call interval on an idle procedure with
fl_set_idle_delta() so an idle callback might be the best choice here.
I think this is a better choice than using FL_CONTINUOUS_FREE if I
understand the problem correctly.

> ... And for the drawing
> area, would a canvas be better? Any suggestions would be appreciated.

Unless you're doing something with a graphics API such as
MesaGL/OpenGL or the like, the Canvas is probably not the best
choice.

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/