[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in refresh() ? :(
From: |
Thomas Dickey |
Subject: |
Re: Bug in refresh() ? :( |
Date: |
Thu, 30 Aug 2001 15:05:05 -0400 |
User-agent: |
Mutt/1.2.5i |
On Thu, Aug 30, 2001 at 11:27:49AM -0500, Dan Nelson wrote:
> In the last episode (Aug 30), Yonglin ma said:
> > Here is the sample program 15-4.c from <<Linux Programing Bible>>.
> >
> > init_pair(1, COLOR_GREEN, COLOR_BLACK);
> > attrset(COLOR_PAIR(1));
> > printw("Notice the existing text printed to the screen with this\n");
> > printw("pair is not modified, but this new text has the new color.\n");
> >
> > But the program doesn't run as expected! the existing text with
> > COLOR_PAIR(1) modified (repaint with the new color)!
>
> The program's comment is wrong. The ncurses init_pair manpage reads:
>
> If the color-pair was previously initialized, the screen is
> refreshed and all occurrences of that color-pair is changed to
> the new definition.
perhaps that book was written against an old version of ncurses (the fix
is post-4.2 btw):
980627
+ modify init_pair so that if a color-pair is reinitialized, we will
repaint the areas of the screen whose color changes, like SVr4 curses
(reported by Christian Maurer <address@hidden>).
--
Thomas E. Dickey <address@hidden>
http://dickey.his.com
ftp://dickey.his.com