Using more lines than the window has with ncurses

前端 未结 1 731
被撕碎了的回忆
被撕碎了的回忆 2021-02-04 21:09

I have recently been introduced to ncurses for asynchronous keyboard key listening, and getting on well with it. One issue i\'m facing is that you can only have tex

1条回答
  •  [愿得一人]
    2021-02-04 21:57

    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 
    
    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;
    }
    

    0 讨论(0)
提交回复
热议问题