NCurses : scrolling a window

Hello everybody,

I'm trying to develop a terminal simulator, and I had add scrolling functionality, with the wscrl() function and activate it with scrollok() before.

But my problem is with the text dissapear in the window when the text overcome the window edge and I don't know how I recover it.

Does anyone know how to do?.

Best regards.
I think you need to call wsetscrreg and idlok also.

The man page says
The setscrreg and wsetscrreg routines allow the application programmer to set a software scrolling region in a window. top and bot are the line numbers of the top and bottom mar-
gin of the scrolling region. (Line 0 is the top line of the window.) If this option and scrollok are enabled, an attempt to move off the bottom margin line causes all lines in
the scrolling region to scroll one line in the direction of the first line. Only the text of the window is scrolled. (Note that this has nothing to do with the use of a physical
scrolling region capability in the terminal, like that in the VT100. If idlok is enabled and the terminal has either a scrolling region or insert/delete line capability, they will
probably be used by the output routines.)


The scrollok option controls what happens when the cursor of a window is moved off the edge of the window or scrolling region, either as a result of a newline action on the bottom
line, or typing the last character of the last line. If disabled, (bf is FALSE), the cursor is left on the bottom line. If enabled, (bf is TRUE), the window is scrolled up one
line (Note that to get the physical scrolling effect on the terminal, it is also necessary to call idlok).

So ncurses should handle it well, here I think the scroll region is not proper. I can see the exact code I may be able to more accurate
Topic archived. No new replies allowed.