When turned on the contents of a window can be scrolled with the following functions. (Note: It would be also scrolled, if you print a new line in the last line of the window. So, be careful with scrollok(...) or you will get unreasonable results.)
The following code should explain how to get the effect of scrolling a text on the screen. Look also in .c in the example directory.
We have a window with 18 lines and 66 columns and want to scroll a text in it. S[] is a character array with the text. Max_s is the number of the last line in s[]. Clear_line will print blank characters from the current cursor position up to the end of the line using the current attributes from the window (not A_NORMAL as clrtoeol does). Beg is the last line from s[] currently shown on the screen. Scroll is an enumerate to tell the function what to do, show the NEXT or PREVious line from the text.