Curses question involving "curscr" and "overwrite()"

Dean Pentcheff dean at violet.berkeley.edu
Mon Nov 14 18:52:53 AEST 1988


I'm trying to write a program that does rudimentary windowing using
curses.  What I need is a way to restore parts of a screen when a small
window is deleted.  I'd really like to do this without reconstructing the
entire set of overlaid windows on the screen each time I, for example,
clear a pull-down menu.

The first idea I had was to copy out the segment of the screen that a
new small window was about to blow away, then restore it once the new
window was gone.  I figured I could do this by creating a shadow window
the size of the new window as the "backup" window, then creating a
subwindow of "curscr" (the alleged virtual screen) of the same size and
location, then copying the curscr-subwindow into the backup window with
overwrite.  Next, create the new window, diddle inside it, delete it,
then wrefresh the backup window.  That should restore the original
screen image of curscr.

Wrong.  It turns out that curscr is somehow inaccessible to overwrite
(on both a BSD and SYSV system), though it does exist and has
reasonable WINDOW structure parameters.

Suggestions on how I might accomplish the job?  Either through more
cleverly accessing curscr, or with an entirely different approach?

-Dean

Dean Pentcheff        dean at violet.berkeley.edu
----------------------------------------------
As an adolescent I aspired to lasting fame, I craved factual certainty, and I
thirsted for a meaningful vision of human life - so I became a scientist.  This
is like becoming an archbishop so you can meet girls.               M. Cartmill



More information about the Comp.unix.wizards mailing list