[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: chgat() function does not work correctly after refresh()
From: |
Thomas Dickey |
Subject: |
Re: chgat() function does not work correctly after refresh() |
Date: |
Sun, 20 May 2007 17:01:17 -0400 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Fri, May 18, 2007 at 03:03:55PM +0400, Alexey Miheev wrote:
> LSB 3.1 refers to SUSv2 (The Single UNIX Specification, Version 2) for the
> description of the libncurses functions.
> According to the standard chgat() family of functions shall change renditions
> of characters in a window.
> But in the following code chgat() do nothing and renditions stay the
> same. Note that if we will comment out first refresh() call then
> everything is OK and renditions are changed. This behaviour seems to be
> quite unpredictable from the documentation.
When I run this program, I see a blinking cyan-on-black string.
Your comment seems to say that commenting out the first refresh
will make a difference in behavior - I don't see that.
It's likely that you're testing with an older version of ncurses.
I see that in 5.5 it did not handle this case (modifying text before
it was first painted on the screen).
The change is probably this one:
20060715
+ modify wchgat() to mark updated cells as changed so a refresh will
repaint those cells (comments by Sadrul H Chowdhury and William
McBrine).
The current version of ncurses is 5.6 (20061217).
> #include <ncurses.h>
>
> int main(int argc, char *argv[])
> { initscr(); /* Start curses mode */
> start_color(); /* Start color functionality */
>
> init_pair(1, COLOR_CYAN, COLOR_BLACK);
> printw("A Big string");
> refresh(); // IF THIS IS COMMENTED THEN EVERYTHING IS OK
> /*
> * First two parameters specify the position at which to start
> * Third parameter number of characters to update. -1 means till
> * end of line
> * Forth parameter is the normal attribute you wanted to give
> * to the charcter
> * Fifth is the color index. It is the index given during init_pair()
> * use 0 if you didn't want color
> * Sixth one is always NULL
> */
> mvchgat(0, 0, -1, A_BLINK, 1, NULL);
> refresh();
> getch();
> endwin(); /* End curses mode */
> return 0;
> }
>
> Regards, Alexey Miheev
>
> Linux Verification Center, ISPRAS
> web: http://www.linuxtesting.org
> e-mail: address@hidden
>
>
>
>
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-ncurses
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature