Re: XForms: Using app-defaults file to set default form values?

T.C. Zhao (
Sat, 20 Dec 1997 22:15:36 -0600

To subscribers of the xforms list from "T.C. Zhao" <> :

On Dec 20, 2:19pm, Steve Lamont wrote:

> You would have to read the app_defaults file and process it.

I hate to contradict the mighty spl, but in this case, I think
there are easier ways to handle the resource file.

> static void set_startup_resources( void )
> {
> FILE *f = fopen( APP_DEFAULT_FILE, "r" );
> if ( f ) {

> The above is a pretty stoneaxe approach but it did work in some
> limited sense.
fl_initialize will read the resources from several places, including
the standard app resource, so application does not have to open/read
the file.

Say, the resource for the input is inputN.content, you can
do the following (content_holder is a char array that will hold the

FL_STRING, default_val, content_holder, size);

or you can lump every resource into a structure

FL_resource res[] = {
{"inputN.content","InputN.Content",FL_STRING, content_holder, 0, size},

fl_get_app_resource(res, Nres);
/* create_all the forms */
fl_set_input(input_object, content_holder);

Of course, for this to work, the application default has to be
in the standard place with standard name.

To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: