Source Code File 12-02_scrolling2
12-02_scrolling2.c
#include <ncurses.h>
int main()
{
char text[] = "This is some wrapping. ";
int x;
initscr();
scrollok(stdscr,TRUE);
for(x=0;x<100;x++)
{
addstr(text);
napms(100);
refresh();
}
getch();
endwin();
return 0;
}
Output Screenshot

Notes
* Unlike the example from 12-01_scrolling1.c, with the scrollok() function setting the scrolling attribute for the standard screen, text scrolls as expected.
Copyright © 1997-2025 by QPBC.
All rights reserved
