Using more lines than a window with ncurses

I recently met ncurses for asynchronously listening to keyboard keys and did a good job of it. One of the problems I am facing is that you can only have text on the visible screen, without scrollbars. I was wondering if it is possible to continue to use ncurses , since it is so beautiful, but the program still holds the scroll bars, and does not fall into the last line and remains there.

+4
source share
1 answer

scrolling () . First you must set scrollok (win, TRUE). In fact, if you just want to cut data like a regular terminal, you need to set scrollok () yourself.

 #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; } 
+11
source

Source: https://habr.com/ru/post/1385004/


All Articles