curses question
Chris Torek
chris at mimsy.UUCP
Fri Jun 3 03:30:42 AEST 1988
In article <440 at wpg.UUCP> russ at wpg.UUCP (Russell Lawrence) writes:
>The program must be able to clear specific windows from a user's
>terminal WITHOUT overwriting the data in the particular WINDOW
>structure. This requirement rules out the use of werase() or wclear()
>but also facilitates redisplaying the "erased" window.
You may be able to do it by opening new blank windows over the old
nonblank windows, but it sounds to me as though you need a real window
manager. Some years ago, I got tired of fighting `curses', and wrote
something called the Maryland Window Library. There are no doubt still
copies of it out there, since I posted it. It has its own
idiosyncrasies (`bugs' :-) ---the whole thing should be rewritten), but
hiding a window from a user without destroying the window is trivial:
Whide(w);
Wrefresh();
does it.
Wunhide(w);
Wrefresh();
brings it back. The most major difference between Maryland Windows and
curses is that MW understands `layering' of windows, and that MW has a
fancy screen update algorithm (adapted from the one in Gosling's ACM
article and in an old version of his Emacs) that consumes too much CPU
time but does use insert and delete. MW also handles four modes (bold,
blink, underline, and inverse-video), assuming the terminal is able
to display such.
Someone should rewrite MW, clean it up and modernise it (termcap
has changed since its day), and then maybe we could supplant curses
as the tty display-handler of choice ... but I doubt it. :-)
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris at mimsy.umd.edu Path: uunet!mimsy!chris
More information about the Comp.unix.questions
mailing list