Saving a Window Image and Restoring it to the Screen

You can save the character-attribute information for a window image (which includes the border, margins, and the current contents of the work area) and store it in the window's structure. Later, you can replace the saved window image on the screen.

To save a window image to memory, use the window image save function, wi_sav():

int wi_sav(wnp)

WINDOWPTR wnp;    /* Pointer to window to save image for    */

This function allocates memory for the complete window image, including borders and margins. The pointer to this memory is saved in the window structure member wnp->storp. If there is already a pointer in the wnp->storp member, that previously-saved window image is freed.

You can later place the saved window image back on the screen with a call to either:

The calls for these functions are as follows:

   
void wi_unsav(wnp)
   
WINDOWPTR wnp;
/* Pointer to window



*/
void wi_rpl(wnp)
   
WINDOWPTR wnp;
/* Pointer to window
*/


Home Contents Previous Next