[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scrolling Problem with Ncurses

From: Thomas Dickey
Subject: Re: Scrolling Problem with Ncurses
Date: Sun, 19 Apr 2009 08:59:40 -0400 (EDT)

On Sun, 19 Apr 2009, Krt_Malta wrote:


I am using Ncurses to develop a text editor in C. I am successfully
scrolling up and down by using, wscrl(stdscr,1); and wscrl(stdscr,-1);
respectively. However, for example, when I scroll down one line, the first
line in the terminal clears ok but when I scroll back up, the first line
does not reappear. It scrolls up, but it gives me an empty line instead.

curses does that - though a quick check of man wscrl doesn't show it mentioned til the "NOTES" section.

The application is supposed to fill in the text after the scrolling operation.

You can use a pad (see newpad) to store a larger "window" than the actual display - this simplifies some of it, but requires some computation to keep track of the viewport.

There's an example in the ncurses program (test/ncurses.c in the sources)
which uses a pad.

Thomas E. Dickey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]