Curses & Color

davej at uicsrd.csrd.uiuc.edu davej at uicsrd.csrd.uiuc.edu
Tue Jun 14 22:19:00 AEST 1988



				
   I need to do colors with curses. Color is done by writing an escape
sequence to the display adapter which puts the display in the mode
for a particular color used for subsequently written chars.

   The problem is the way curses trys to efficiently update the display.
It seems that 'cursrc' contains the current image of the actual display.
Assume the window I'm using is 'stdsrc'. If I write chars to 'stdscr' that
are intended to be in a new color, on a 'refresh' a char is actually 
written to the display only if its char. value is different from that
in 'curscr'. So old chars may remain on the display in the incorrect
color.

   I thought 'touchwin' was the answer to my problems, but all this
call seems to do is set some parameters so that the entire 'strdscr'
is compared against 'curscr' for differences; 'curscr' still acts as
a filter.

   I'm sure somebody must have done colors with curses and has gotten
around this problem.

   Any advice is greatly appreciated.



More information about the Comp.unix.wizards mailing list