bug-ncurses
[Top][All Lists]
Advanced

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

chgat() function does not work correctly after refresh()


From: Alexey Miheev
Subject: chgat() function does not work correctly after refresh()
Date: Fri, 18 May 2007 15:03:55 +0400

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.


#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






reply via email to

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