[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
setscrreg behavior
From: |
Dan Gookin |
Subject: |
setscrreg behavior |
Date: |
Mon, 6 Mar 2006 17:11:40 -0800 |
Greetings, all. Doing more tests here...
In my tests of the setscrreg() function I've found some weird behavior
that I haven't seen documented anywhere.
When I try to put text below a scrolling region in the middle of a
window the \n appears in the scrolling region and not below it. This
code demonstrates:
#include <curses.h>
int main()
{
initscr();
scrollok(stdscr,TRUE);
setscrreg(0,3);
addstr("Hello.");
refresh();
getchar();
mvaddstr(4,0,"Obligatory text.\n");
refresh();
getchar();
endwin();
return(0);
}
The effect of the mvaddstr() function is to display its text on line
4, but the \n from that string somehow appears on line 3 in the
scrolling region. Visually this scrolls up line 0 with "Hello" into
oblivion.
Displaying the new line anwhere else behaves as expected. E.g., if the
scrolling region omits lines at the top of a window, then the \n
displays fine on those lines. It's only the lines below the scrolling
region that have this issue.
This was tested on xterm in Mac OS X using NCurses 5.4 as well as
FreeBSD with a more ancient version of NCurses.
Thanks for any insight you can offer.
DAN
- setscrreg behavior,
Dan Gookin <=