home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / lang / skel_azt.sha / update.c < prev   
C/C++ Source or Header  |  1986-07-08  |  521b  |  33 lines

  1.  
  2. /*
  3.  *    update.c -- handle an update event for any window
  4.  */
  5.  
  6. #include <quickdraw.h>
  7. #include <event.h>
  8. #include <window.h>
  9.  
  10. #include "def.h"
  11.  
  12. void
  13. update(ev)
  14. EventRecord    *ev;    /* return value from GetNextEvent */
  15. {
  16.     int                    i;
  17.     GrafPtr                saveport;
  18.     extern    WindowPtr    wp[NWINDOWS];
  19.     
  20.     for (i = 0;  i < NWINDOWS;  i++)
  21.         if ((WindowPtr)ev->message == wp[i]) {
  22.             BeginUpdate(wp[i]);
  23.             GetPort(&saveport);
  24.             SetPort(wp[i]);
  25.     
  26.             redraw(i);
  27.  
  28.             SetPort(saveport);
  29.             EndUpdate(wp[i]);
  30.             break;
  31.         };
  32. } /* end of update */
  33.