redrawing on ncurses

Posted by John C on Stack Overflow See other posts from Stack Overflow or by John C
Published on 2010-03-20T05:48:40Z Indexed on 2010/03/20 5:51 UTC
Read the original article Hit count: 380

Filed under:
|

I'm trying to redraw the content of a simple loop. So far it prints out to the stdscr 100 lines, and then by using scrl to scroll n lines I get n blank rows.

What I want is to keep with the sequence. However, I'm not sure how to redraw the stdscr with the n extra lines. Any ideas will be appreciate it!

#include <ncurses.h>
int main(void)
{
    initscr();
    int maxy,maxx,y;
    getmaxyx(stdscr,maxy,maxx);
    scrollok(stdscr,TRUE);
    for(y=0;y<=100;y++)
        mvprintw(y,0,"This is some text written to line %d.",y);
    refresh();
    getch();
    scrl(5);
    refresh();
    getch();
    endwin();
    return(0);
}

© Stack Overflow or respective owner

Related posts about c

    Related posts about ncurses