home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / screen / scremo10.lha / ScreenMod / Source / iconify.c < prev    next >
Text File  |  1991-06-06  |  1KB  |  56 lines

  1. /*********************** iconify ************************\
  2.  *    Written by Syd L. Bolton ©1991 Legendary Design   *
  3.  *      Module for ScreenMod ... Date: May 2, 1991      *
  4. \********************************************************/
  5.  
  6. #include "iconify.h"
  7.  
  8. iconify()
  9. {
  10. struct Window *IWindow;
  11. struct IntuiMessage *message;
  12. ULONG class;
  13. int icon_exit=0;
  14.  
  15. if (Window) ClearMenuStrip(Window);
  16. if (Window) CloseWindow(Window);
  17. if (Screen) CloseScreen(Screen);    /* this finishes off main program */
  18.  
  19. IWindow=OpenWindow(&IconWindow);
  20. if (IWindow==NULL) {
  21.     puts("Couldn't open tiny window!!!");
  22.     exit(1);
  23.     }
  24.     
  25. /* now sleep until something happens ... */
  26.  
  27. do {
  28.     WaitPort(IWindow->UserPort);
  29.         while ( ( message=(struct IntuiMessage *)
  30.             GetMsg(IWindow->UserPort) ) != NULL)
  31.         {
  32.         class=message->Class;
  33.         ReplyMsg(message);
  34.  
  35.         if (class==MOUSEBUTTONS) icon_exit=1;
  36.         if (class==CLOSEWINDOW) icon_exit=2;
  37.         }
  38.     } while (icon_exit==0);
  39.  
  40. CloseWindow(IWindow);
  41.  
  42. if (icon_exit==2) {
  43.     if (GfxBase) CloseLibrary(GfxBase);
  44.     if (IntuitionBase) CloseLibrary(IntuitionBase);
  45.     exit(1);
  46.     }
  47.  
  48. opendisplay();
  49. screenlist();
  50. scr=ß
  51. updatestats();
  52.  
  53. return(0);
  54. }
  55.  
  56.