Icon

Tag Type C++ code (built in to libHForm/scan_body.cc)
Attributes var=varName Optional. Sets the variable name whose icon we want to display. Without any other options, the possible choices for a icon are assumed to be a gif listed in (private or public) variables named varName_icon[value1]="icon1", varName_icon[value2]="icon2", etc.
src=filename.gif Optional. Can be specified instead of var to directly give the name of a GIF image to display.
base=/path/to/images Optional. Default is to search for gifs in the current directory, ~rpm/images/, and DOCROOT/images/.
ext=.gif Optional. This could be set to something like ".jpg" if the icons were jpeg files.
width=pixels and
height=pixels
Optional. The standard, default size for all RPM icons is 36x36.
choices=listName Optional. Changes the possible value list for var to be off the pattern listName_icon[value1]="icon1", listName_icon[value2]="icon2", etc.
prefix=string and
postfix=string
The default values for these are prefix="%choices;_icon[" and postfix="]". %choices; will be replaced by var (or choices, if choices is given). If you change these, they will remain set for all subsequent Icon tags.
setWhen present, allows you to set up prefix and postfix without actually creating an icon.
value=stringOptional. Causes the appropriate icon for var to be inserted as if it had "string" as its value.
noTagIf present, causes only the filename of the GIF to be printed rather than the whole <IMG ...> tag.
Contained Tags None.
Related Tags This tag must appear in the Body section.
Comments Despite all the attributes possible for Icon, it is really quite simple to use. RPM has many icons (in GIF files) "built-in" and ready for use. The following example uses two of these to display a light bulb on or off depending on the state of a variable. This also demonstrates the "onChange" option of the Menu tag.