Skip to main content

[Migrated content. Thread originally posted on 03 October 2005]

I want to change the background and foreground colors of entry-fields, labels etc...

Using W$PALETTE, I get values in WPAL-RED WPAL-GREEN WPAL-BLUE.

How do one have to code these values to change f.i. the background of an entry-field ?

[Migrated content. Thread originally posted on 03 October 2005]

I want to change the background and foreground colors of entry-fields, labels etc...

Using W$PALETTE, I get values in WPAL-RED WPAL-GREEN WPAL-BLUE.

How do one have to code these values to change f.i. the background of an entry-field ?
This code works for setting the foreground and background colors:

initialize wpalette-data.
call "W$PALETTE" using 1, WPALETTE-DATA
giving result.
if result = WPAL-FULL-SUPPORT
call "W$PALETTE" using WPALETTE-CHOOSE-COLOR
WPALETTE-DATA giving result
if result not equal WPERR-CANCELLED
call "W$PALETTE" using WPALETTE-SET-COLOR,
WPALETTE-DATA giving result.

[Migrated content. Thread originally posted on 03 October 2005]

I want to change the background and foreground colors of entry-fields, labels etc...

Using W$PALETTE, I get values in WPAL-RED WPAL-GREEN WPAL-BLUE.

How do one have to code these values to change f.i. the background of an entry-field ?
I was aware of this function but thanks anyway.
Meanwhile I figured it out myself.

Your code changes a certain color indead. But then to change the back- and foreground-color of an entry-field, one just have to use the basic values of that color.

For instance : MODIFY ENTRY-FIELD, COLOR = 48

This will set the background-color to black (32) and the foreground-color to white (16)... whatever RGB-value one set for black and white.