home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Reference_Library / lib_examples / newlookscreen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-21  |  1.6 KB  |  58 lines

  1. /* newlookscreen.c
  2. ** open a screen with the "new look".
  3. **
  4. ** SAS/C 5.10a
  5. ** lc -b1 -cfist -v -y newlookscreen
  6. ** blink LIB:c.o newlookscreen.o TO newlookscreen LIB LIB:lc.lib LIB:amiga.lib
  7. */
  8.  
  9. #define INTUI_V36_NAMES_ONLY
  10.  
  11. #include <exec/types.h>
  12. #include <intuition/intuition.h>
  13. #include <intuition/screens.h>
  14.  
  15. #include <clib/exec_protos.h>
  16. #include <clib/dos_protos.h>
  17. #include <clib/intuition_protos.h>
  18.  
  19. #ifdef LATTICE
  20. int CXBRK(void)    { return(0); }  /* Disable Lattice CTRL/C handling */
  21. int chkabort(void) { return(0); }  /* really */
  22. #endif
  23.  
  24. struct Library *IntuitionBase;
  25.  
  26. /* Simple routine to demonstrate opening a screen with the new look.
  27. ** Simply supply the tag SA_Pens along with a minimal pen specification,
  28. ** Intuition will fill in all unspecified values with defaults.
  29. ** Since we are not supplying values, all are Intuition defaults.
  30. */
  31. VOID main(int argc, char **argv)
  32. {
  33. UWORD pens[] = { ~0 };
  34. struct Screen *my_screen;
  35.  
  36. IntuitionBase = OpenLibrary("intuition.library",0);
  37. if (NULL != IntuitionBase)
  38.     {
  39.     if (IntuitionBase->lib_Version >= 37)
  40.         {
  41.         /* The screen is opened two bitplanes deep so that the
  42.         ** new look will show-up better.
  43.         */
  44.         if (NULL != (my_screen = OpenScreenTags(NULL,
  45.                                      SA_Pens, (ULONG)pens,
  46.                                      SA_Depth, 2,
  47.                                      TAG_DONE)))
  48.             {
  49.             /* screen successfully opened */
  50.             Delay(30L);  /* normally the program would be here */
  51.  
  52.             CloseScreen(my_screen);
  53.             }
  54.         }
  55.     CloseLibrary(IntuitionBase);
  56.     }
  57. }
  58.