Using more lines than the window has with ncurses

折月煮酒 提交于 2019-12-03 03:47:11

scroll(). You have to set scrollok(win, TRUE) first. Actually if you just want to spew data like a normal terminal you only need to set scrollok() by itself.

#include <ncurses.h>

int main(void)
{
    int i = 0;

    initscr();

    scrollok(stdscr,TRUE);

    while(1)
    {
        printw("%d - lots and lots of lines flowing down the terminal\n", i);
        ++i;
        refresh();
    }

    endwin();
    return 0;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!