Re: XForms: Getting info from objects in callbacks.

From: Steve Lamont (
Date: Thu Jul 20 2000 - 17:31:23 EDT

  • Next message: Jon Guerin: "Re: XForms: Getting info from objects in callbacks."

    # To subscribers of the xforms list from Steve Lamont <> :

    > 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


    [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 or see
    XForms Home Page:
    List Archive:

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