Re: XForms: displaying results

Steve Lamont (spl@szechuan.ucsd.edu)
Sat, 10 Apr 99 13:21:26 PDT

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

> I compile and get:
>
> martin1.c:
> martin1_cb.c:
> cfe: Error: martin1_cb.c, line 32: 'fd_martin1' undefined; reoccurrences
> will not be reported.
> readout(fd_martin1->result_compd, "%g", M_compd);
> --------^
> martin1_main.c:
> mproc.c:
>
> My files here in this case are called martin1_something; so I assume
> fd_martin1 is the right thing?!

The fd_whatever just means the name of the instance of the data
structure produced by the create_form_whatever and should correspond
to your FD structure.

So, if you do something like

FD_whatever *whatever;

[...]

whatever = create_form_whatever();

and there is an object (or, more accurately, a member) within the
`FD_whatever' data structure called `text_object' then your call to
readout() should look like

readout( whatever->text_object, "%g", your_number );

I generally use the `fd_' prefix in examples to this list because
that's how most people who use XForms name their data structures -- no
other reason than just convention. For example, if you tell `fdesign'
to create a main for you, it will generate something like:

#include "forms.h"
#include "try.h"

int main(int argc, char *argv[])

{

FD_try *fd_try;
FD_folder_stuff *fd_folder_stuff;

fl_initialize(&argc, argv, 0, 0, 0);
fd_try = create_form_try();
fd_folder_stuff = create_form_folder_stuff();

/* fill-in form initialization code */

/* show the first form */

fl_show_form(fd_try->try,FL_PLACE_CENTERFREE,FL_FULLBORDER,"try");

fl_do_forms();

return 0;

}

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/