[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Avoiding clearing the screen
From: |
Thomas Dickey |
Subject: |
Re: Avoiding clearing the screen |
Date: |
Mon, 24 Dec 2007 10:25:32 -0500 |
User-agent: |
Mutt/1.5.17 (2007-11-01) |
On Thu, Dec 20, 2007 at 09:03:01AM +0100, Christer Enfors wrote:
> Now, my problem is that the entire screen is cleared when I press a key to
> go up or down in the menu, which causes some terminals to flicker terribly.
> I was expecting ncurses to only redraw a subsection of the menu - the menu
> item that was previously selected, and the new one. That the entire screen
> is cleared is strange to me, because I don't clear the entire screen - I
> only clear one of my windows (which takes up the bottom fifth of the
> screen).
> The function that causes the screen to be cleared is doupdate().
...
> while (done == 0)
> {
> switch (getch()) /* User presses j or KEY_DOWN here. */
By the way, getch does a refresh, which in turn calls doupdate().
> wclear(win); /* Clear the bottom fifth of the screen. This is the
> * only part of the relevant code where any type of
> * clear function is called.
> */
Looking at the code for 'refresh', I see the problem:
if (win->_clear) {
win->_clear = FALSE;
newscr->_clear = TRUE;
}
...which is telling it that if any window does wclear(), then the working
window 'newscr' is cleared. If you use werase() you should get the
expected result.
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature