home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 348.lha / chatterbox_v1.0 / sources / display.c < prev    next >
C/C++ Source or Header  |  1990-02-14  |  999b  |  59 lines

  1. #include <functions.h>
  2. #include <exec/types.h>
  3. #include <exec/devices.h>
  4. #include <graphics/gfx.h>
  5. #include <intuition/intuition.h>
  6. #include <ctype.h>
  7.  
  8. extern struct NewWindow XNewWindowStructure1;
  9. extern struct Menu XMenu1;
  10. struct Window *win = NULL;
  11.  
  12. struct GfxBase *GfxBase = NULL;
  13. struct IntuitionBase *IntuitionBase = NULL;
  14.  
  15. int display_up;
  16.  
  17. trash_libs()
  18. {
  19.     if (GfxBase) 
  20.         CloseLibrary(GfxBase);
  21.     if (IntuitionBase) 
  22.         CloseLibrary(IntuitionBase);
  23. }
  24.  
  25. InitLibraries()
  26. {
  27.     add_cleanup(trash_libs);
  28.  
  29.     if(!(GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 0L))) 
  30.         panic("Can't open graphics.library");
  31.  
  32.     if (!(IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0L)))
  33.         panic("Can't open intuition.library");
  34. }
  35.  
  36. trash_window()
  37. {
  38.     if (win)
  39.     {
  40.         ClearMenuStrip(win);
  41.         CloseWindow(win);
  42.     }
  43. }
  44.  
  45. InitWindow()
  46. {
  47.     int i;
  48.  
  49.     win = 0;
  50.  
  51.     if (!(win = OpenWindow(&XNewWindowStructure1)))
  52.         panic("can't open window");
  53.  
  54.     SetMenuStrip(win,&XMenu1);
  55.  
  56.     add_cleanup(trash_window);
  57. }
  58.  
  59.