Re: ncurses addch: how to get "normal" newline behavior?
- From: Thomas Dickey <dickey@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Apr 2007 11:03:56 -0000
Grant Edwards <grante@xxxxxxxx> wrote:
Is there anyway to get addch() to treat a linefeed character
like a normal terminal does? Instead of linefeed being treated
as an EOL+return+linefeed sequence, I'd like a linefeed to be
just a linefeed.
something like (untested - different logic needed if the window can scroll)
int addexact(int ch)
{
int result;
if (ch == '\n') {
int y, x;
getyx(stdscr, y, x);
result = wmove(stdscr, y + 1, x);
} else {
result = addch(ch);
}
return result;
}
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
.
- Follow-Ups:
- Re: ncurses addch: how to get "normal" newline behavior?
- From: Grant Edwards
- Re: ncurses addch: how to get "normal" newline behavior?
- References:
- ncurses addch: how to get "normal" newline behavior?
- From: Grant Edwards
- ncurses addch: how to get "normal" newline behavior?
- Prev by Date: Reusing the location bar in GTKFileChooser Widget
- Next by Date: Re: Switching from win32
- Previous by thread: ncurses addch: how to get "normal" newline behavior?
- Next by thread: Re: ncurses addch: how to get "normal" newline behavior?
- Index(es):