Curses question

Leo de Wit leo at philmds.UUCP
Wed Jun 29 05:56:34 AEST 1988


In article <376 at dlscg1.UUCP> dlsc1032 at dlscg1.UUCP (Alan Beal) writes:
|I am looking for an example curses program that forks/execs a process, reads
|the output(both stdout and stderr) from the process, and displays the output
|in a small window by scrolling.  The output window will be a small part of
|the original screen and I would like the process's output to only scroll 
|within the output window.  In an attempt to learn how to do this, I have
|found that using mvwaddstr() will not cause scrolling if you move text 
|beyond the limits(x-axis) of the defined window.  If I just keep using
|addstr(), the text will go beyond the x and y limits of the window and
|logical scrolling will occur.  Is there a proper way to do all of this?    
|I am using the Nutshell Curses book as a reference but as usual there are
|too few examples and only short explanations.  Are there any more fuller
|discussons or examples of how to use curses in this manner out there?

>From the article Screen Updating and Cursor Movement Optimization:
A Library Package (by Kenneth C.R.C. Arnold):

scrollok(win,boolf)
WINDOW win;
bool boolf;

    Sets the scroll flag for the given window. If boolf is FALSE, scrolling
    is not allowed. This is its default setting.

Perhaps using scrollok() on your window with boolf == TRUE solves your
problem.

    Leo.



More information about the Comp.unix.questions mailing list