Problem with ncurses and spaces
I am writing an ncurses application that clears fields on the screen by writing spaces to them. For longer fields (greater than 15 characters or so) this doesn't seem to work properly. It behaves as if ncurses is ignoring the updated characters and not sending them to the terminal. This happens despite the fact that I am calling wrefresh() after updating the characters. For example, suppose I have a field that initially contains "abcdefghijklmnopqrstuvwxyz". I attempt to clear the field using the following code:
waddstr(hWindow,
" "); // String of 26 space characters
wrefresh();
When I execute this code, there is no visible effect on the terminal screen; it's as if ncurses doesn't recognize the modified characters, or suppresses sending them to the terminal for some reason.
However, as soon as I modify the screen in any other way (such as writing a single non-blank character to any location of the screen and then calling wrefresh()), the previously-cleared field is instantly updated on the terminal screen, too. It's as if the first update is "deferred" pending the subsequent update.
I haven't a clue as to why ncurses behaves this way, and don't know if it's a subtle bug of some sort, or a procedural error on my part.
Anyway, if anyone can shed some light on this, I'd certainly appreciate it. Thanks!
Last edited by joeuser; 12-21-2002 at 11:11 AM.
|