When you create the button (or any other widget), assign a name on the
Button Properties screen.
In Pre-Display, based on the condition you wish to check:
SET --- WIDGET NAME = <Name you gave the widget>
READ --- WIDGET HOLD 1 FT 0 BY WIDGET NAME
F CANCEL Widgit not found
IF <Condition you need to test on>
T SET --- WIDGET COLOR EN FG R = <red value: 0-255>
T SET --- WIDGET COLOR EN FG B = <blue value: 0-255>
T SET --- WIDGET COLOR EN FG G = <green value 0-255>
T SET --- WIDGET COLOR EN BG R = <red value: 0-255>
T SET --- WIDGET COLOR EN BG B = <blue value: 0-255>
T SET --- WIDGET COLOR EN BG G = <green value 0-255>
* Set the default color for button
F SET --- WIDGET COLOR EN FG R = <red value: 0-255>
F SET --- WIDGET COLOR EN FG B = <blue value: 0-255>
F SET --- WIDGET COLOR EN FG G = <green value 0-255>
F SET --- WIDGET COLOR EN BG R = <red value: 0-255>
F SET --- WIDGET COLOR EN BG B = <blue value: 0-255>
F SET --- WIDGET COLOR EN BG G = <green value 0-255>
*
SET --- WIDGET COLOR EN FG NL = 1 <so color is not ignored>
SET --- WIDGET COLOR EN BG NL = 1 <so color is not ignored>
REWRITE --- WIDGET FAIL 0
The color values are the decimal values for the colors. For example; hex
color value #FFFFFF (white) is decimal value 255 for red, green, and blue.
The FG fields set the text color (foreground) on the button. The BG fields
set the background color. When you save the ILF READ and WRITE statements,
if it says the widget file could not be found, use Opt 88 to save the code. |