Re: XForms: Getting info from objects in callbacks.

From: Jon Guerin (jguerin@home.com)
Date: Thu Jul 20 2000 - 17:53:57 EDT

  • Next message: Rajaram Kaliyaperumal: "XForms: remove button in form"

    # To subscribers of the xforms list from Jon Guerin <jguerin@home.com> :

    9_9 Thanks much steve that's the answer I was looking for. I flipped through
    the FL_OBJECT structure page earlier, cuz my instinct told me there'd be some
    kind of member in there that would point to the owner form in there somewhere,
    but it wasn't listed. I think I saw that technique you suggested somewhere in
    the manual but err... I would have expected it to be in the FL_OBJECT structure
    list ^_^. Thanks!

    Steve Lamont wrote:

    > # To subscribers of the xforms list from Steve Lamont <spl@ncmir.ucsd.edu> :
    >
    > > I have 2 text fields and a button. I need it so that the button, when
    > > pressed, does an atoi on those 2 text fields. ...
    > > [...]
    > > void CB_Btn_Routine(...)
    > > {
    > > char *f1, *f2;
    > > f1 = atoi(fl_get_input(field1)); // <- How do I get address/etc of
    > > this field?
    >
    > If your Input objects are in the same Form as the Button object, and
    > you used `fdesign' to create the form specification[1], then you can do
    >
    > void your_callback( FL_OBJECT *obj, long parm )
    >
    > {
    >
    > FD_your_form_structure *fd_your_form_structure =
    > ( FD_your_form_structure *) obj->form->fdui;
    > int f1;
    > int f2;
    >
    > f1 = atoi( fl_get_input( fd_your_form_structure->field1 ) );
    > f2 = atoi( fl_get_input( fd_your_form_structure->field2 ) );
    >
    > [...]
    >
    > }
    >
    > Each FL_OBJECT structure has a pointer member pointing back to the form
    > which contains it and the FL_FORM structure has a pointer to the an
    > object of type `FD_any', which can be cast to your form definition
    > structure.
    >
    > spl
    >
    > [1] If you didn't then things are a bit more complicated, depending on
    > what data structures you chose to design to contain the description of
    > the Form, however most folks just use `fdesign', I'd wager.
    > _________________________________________________
    > 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://world.std.com/~xforms
    > List Archive: http://bob.usuhs.mil/mailserv/list-archives/

    _________________________________________________
    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://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/



    This archive was generated by hypermail 2b29 : Thu Jul 20 2000 - 13:57:50 EDT