Re: XForms: ?

vsexton (vsexton@sirinet.net)
Thu, 04 Jun 1998 21:18:46 -0500

# To subscribers of the xforms list from vsexton <vsexton@sirinet.net> :

> > Each object points back to its parent form and the parent form points
> > to the FD_* object (via an appropriate type cast). From there, you
> > can get to any object in the form.
>
> each of my 10 FD_xx structs are defined globally. But instead of having to
> do (as said in the manual on pg 100)
>
> FD_xx *fdxx = ob->form->fdui;
> fl_set_object_xx (fdxx->obj)
>
> I want to be able to access an object just from the passed in object. Why
> bother creating another FD_xx variable when they are already global? It
> doesn't save me anything.
>
> how can I make it so that I can access this callback regardless
> of which form has called it? All of my input fields on ALL of my forms
> call the same callback function, which parses the input of that field, and
> it -should- set a text label on the current form that is calling the
> callback.
>
> If not possible.. the only alternative that I can think of is that when
> the callback is called, case on a form_id as the long that is passed
> down and fl_set_label (xxx_fdui->prompt). So I would have a case statement
> with 10 entries, with each setting the label of the text box on the
> appropriate form.
>

Try doing something else the manual suggests: Pass a value in the data
field to the callback function. Each object passes a unique value. Case on
that, if you must. Then, using your global
forms, access the appropriate object label. No need for more FD_xx variables.
There are other possibilities as well, but this is the most straight-forward,
if simplistic.

Veronica

_________________________________________________
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/