resources

Dr. T.C. Zhao (zhao@bragg.phys.uwm.edu)
Thu, 13 Feb 1997 14:54:29 -0600

To subscribers of the xforms list from "Dr. T.C. Zhao" <zhao@bragg.phys.uwm.edu> :

I thought I sent a reply to the list, but apparently
I did not. Anyhow,
fl_set_resource and fl_get_resource provide
general name-value pair handling that can be
tailored to one's needs via a simple wrapper.
Basically, you can associated an arbitary name string
with an arbitary value:

fl_set_resource("ImportantVar","var_a");
and use fl_get_resource("ImportantVar",...)
to retrieve the value anywhere in your program.

To simplify things a bit, you might want create integer routines

fl_set_integer(char *name, int val)
{
char buf[32];

sprintf(buf,"%d",val);
fl_set_resource(name,buf);
}

and do a similar thing with fl_get_resource.

I guess that the important thing about set_resource etc
is that arbitary string can be used, not only those
that follow the X resource syntax.

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