
IMPORTANT NOTE:

This is included in the Xpm distribution "as is", meaning there is absolutely
no support for this piece of code. I put it however because I have it on my
disk and think it may be useful to you.

Arnaud Le Hors.

Follows the original README:
-------------------------------------------------------------------------
  README, backgroundtest
  Copyright 1991 Robert H. Forsman Jr.  <thoth@manatee.cis.ufl.edu>
	Gnu General Public License


  This backgroundtest program is the second incarnation of the XPM
String to Pixmap converter designed for the X Toolkit.  Like the
String to Bitmap converter already available, the StrToPmap converter
accepts a string that is interpreted as a filename and searches the
"PixmapFilePath" (analogous to the BitmapFilePath resource) for a file
with that name.

  The enhancement from the first version is that color overrides are
possible.  The string passed to the StrToPmap converter is interpreted
as a series of words separated by whitespace.  The first word is the
filename, the second word (if present) is a symbol that is going to be
replaced by the third word.  Even words are symbols and odd words (#3
and up) are replacement values.  So the following spec

BackgroundTest.pixmaps.mickey2: mickey.xpm s_#FFFFFF red s_#000000 green

 replaces symbol s_#FFFFFF with the color red and s_#000000 with the
color green (these goofy names are a side-effect of the conversion
script.  I started with xpm1 images).

  This parsing is very simpleminded.  It does not handle color names
with whitespace (every color name in the MIT database has two forms,
with and without spaces).  It does not handle filenames with
whitespace.  I can see no reason to allow filenames or color names
with spaces.  Files can be renamed to something reasonable and colors
can always be represented by #xxx.  If you consider this a SERIOUS
drawback I can add backslash escapes, but it's a lot more effort for a
minor gain.



  To compile backgroundtest, look at the makefile.  Change the XPM
variable to reflect the location of your xpm library.  The next
library list should be accurate for most systems.  You probably need
to edit the INCLUDEFLAGS to reflect the location of your xpm header
files.  Next type make.  It should compile, no problem, on sun3s and
sun4s. Anything else is totally unwarrantied.  Please contact me with
any compilation problems you have because I can't fix something I
don't know is broken.

  The specific operation of the backgroundtest program is as follows.
It reads its "pixmaps" resource to get a list of resource names.  In
the distributed backgroundtest.xres this list is "next mickey koala
mickey2".
  backgroundtest scans through this list of names and for each name it
reads the corresponding subresource into a pixmap.  It will first
convert the value of pixmaps.next into a pixmap.  Then it creates a
button whose sole action is to change the containing Box background to
this pixmap.  It continues to read pixmaps and create buttons until it
runs out of names.
  If the above explanation does not make sense, read the file
backgroundtest.xres, merge it into your resource database with "xrdb
-merge backgroundtest.xres", and run the program.  Feel free to add
other pixmaps on your PixmapFilePath.
