Re: XForms: dynamically adding objects

Steve Lamont (spl@szechuan.ucsd.edu)
Tue, 27 Jul 99 07:05:19 PDT

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

> ... is there a function that will let me move or anchor an object?
> see, I want to have a background pixmap and then some others that will
> be added on top. The thing is, I might want the background changed
> later on but I don't want it coming to the top like it is now. ...

The basic function to do this is fl_redraw_form(). It will cause the
entire form to be redrawn, in order.

If the background Pixmap is large or the form is complicated, this may
cause an unpleasant amount of flicker. This can be alleviated by
making the form double buffered and bracketing the redraw and update
with fl_freeze_form()/fl_unfreeze_form() calls:

FD_try *fd_try = ( FD_try *) ob->form->fdui;

[...]

fl_set_form_dblbuffer( ob->form, 1 );

fl_freeze_form( ob->form );

fl_free_pixmap_pixmap( fd_try->background_pixmap );
fl_set_pixmap_data( fd_try->background_pixmap, new );

fl_redraw_form( ob->form );

fl_unfreeze_form( ob->form );

fl_set_form_dblbuffer( ob->form, 0 );

Bracketing the whole mess with fl_set_form_dblbuffer() allows the rest
of the form processing to be handled in a single buffer mode, which
generally produces better apparent performance. Double buffering
introduces a bit of a delay in updating forms, particularly relatively
complicated ones.

spl

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/