Re: XForms: FORMS INTERACTION

Steve Lamont (spl@szechuan.ucsd.edu)
Fri, 22 May 98 06:50:32 PDT

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

> I had the exact same problem.. what I had to do is make the fdui's of each
> of the forms that i wanted to interact with, global. So once they are
> global.. you can reference the form (x_fdui->form) and then you can hide
> that form only. Other wise she'll crash.

You don't necessarily need to make the `fdui' structure global. You
can chase pointers from the object back to the `fdui':

void some_callback_cb( FL_OBJECT *ob, long data )

{

FD_my_dui *my_dui = ( FD_my_dui *) ob->form->fdui;

[...]

Of course, if you want to manipulate some other form's objects you
will need to either make that form's `fdui' visible globally or use a
data structure attached to all of the `fdui's to manage the data.

This technique is especially useful if you need a facility to "clone"
a form -- that is, create a new instantiation of the form, for
instance in image processing where you'd like a magged up version of a
region of interest and a scaled down version for a synoptic view of
the image or, to give another example, in a text editor program where
you want to be able to edit separate sections of the same file in
separate windows (the `emacs' "make-frame-command" function).

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/