Can CURSES do a simple scroll?

Nikos B. Troullinos nicktrou at rodan.acs.syr.edu
Wed Sep 12 15:16:41 AEST 1990


Can anyone shed some light in the following perplexing problem?

I am trying to use CURSES in a program where decent scrolling off the 
screen is required when the cursor is in the last line and a newline
is echoed (how unusual!)

Compiling with cc under SUN OS 4.1 I get scrolling but also repainting
of the whole screen for each and every scroll! (whether idlok() is there or
not)

Compiling with /usr/5bin/cc (and the corresponding library) things
improve but instead of a simple echoing of a nl/cr, the insert/delete
capabilities of the terminal (vt100) are used and the cursor is sent for
a brief time on the upper left 'home' position. This is very noticeable
at a low baud rate.

Is it too much to ask for curses to behave reasonably and just send a nl/cr?

Or am I missing something really obvious? My little test program follows:

Nikos Troullinos, CIS
Syracuse University
---------------------------------------------------------------------------
#include <curses.h>
#define EOT 0x4

/* 
   Minimum curses program to make curses do A SIMPLE SCROLLING 
   under SUN OS 4.1 and with a vt100 terminal setting.
*/

void main()
{
int c;

   initscr();
   cbreak();
   noecho();
   nl(); 
   idlok(stdscr, TRUE);
   scrollok(stdscr, TRUE);  
   refresh();

   while ((c=getch()) != EOT) 
     {addch(c);refresh();}

   refresh();
   endwin();
}



More information about the Comp.unix.programmer mailing list