bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in refresh() ? :(


From: Dan Nelson
Subject: Re: Bug in refresh() ? :(
Date: Thu, 30 Aug 2001 11:27:49 -0500
User-agent: Mutt/1.3.21i

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.

-- 
        Dan Nelson
        address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]