home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / AECUR101 / SAVESCR.C < prev    next >
C/C++ Source or Header  |  1990-03-08  |  748b  |  44 lines

  1. /*----------------------------------------------------------------------
  2.  *
  3.  *  savescr.c 
  4.  *
  5.  *  copyright (c) 1987,88,89,90 J. Alan Eldridge
  6.  *
  7.  *  save and restore an area of curscr, including cursor position
  8.  *
  9.  *----------------------------------------------------------------------
  10.  */
  11.  
  12. #include "curses.h"
  13.  
  14. WINDOW *newwin();
  15.  
  16. WINDOW *
  17. savescr(r,c,y,x)
  18. {
  19.     WINDOW *win;
  20.     
  21.     win = newwin(r,c,y,x);
  22.     if (win) {
  23.         overwrite(curscr, win);
  24.         getyx(curscr, y, x);
  25.         wmove(win, y, x);
  26.     }
  27.  
  28.     return win;
  29. }
  30.  
  31.  
  32. void
  33. restscr(win)
  34. WINDOW *win;
  35. {
  36.     int y, x;
  37.     
  38.     getyx(win, y, x);
  39.     wmove(win, 0, 0);
  40.     wrefresh(win);
  41.     wmove(curscr, y, x);
  42.     mvcur(0, 0, y, x);
  43. }
  44.