home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 092.lha / Small / small1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-21  |  1.3 KB  |  58 lines

  1. echo ; /*
  2.  
  3. lc -L small1.c
  4. QUIT
  5.   
  6.    The above code will compile and link this source if you EXECUTE small.c
  7.          
  8.    this code is to try to see how small ( executable ) this code can be 
  9.    The code will open a window and then print 'lets get small' in the 
  10.    window */
  11.  
  12. #include "exec/types.h"
  13.  
  14. #include "intuition/intuition.h"
  15. #include "intuition/intuitionbase.h"
  16.  
  17. struct  IntuitionBase *IntuitionBase;
  18.  
  19. static struct IntuiText text = {3,4,JAM1, 0, 0,NULL,"lets get small", NULL};
  20. static struct NewWindow NW = {50,50,200,40,-1,-1,CLOSEWINDOW,
  21.                               WINDOWCLOSE | WINDOWDRAG,
  22.                               NULL,NULL,"small",NULL,NULL,200,40,200,40,
  23.                               WBENCHSCREEN};
  24. static struct Window *W;
  25.  
  26. void main ()
  27.  
  28. {
  29.    IntuitionBase = (struct IntuitionBase *) 
  30.                    OpenLibrary("intuition.library",0);
  31.  
  32.    if (IntuitionBase == NULL )
  33.       {
  34.       /* the intuition library was not opened so we exit */
  35.       exit (FALSE);
  36.       }
  37.  
  38.    W = ( struct Window * ) OpenWindow ( &NW );    
  39.  
  40.    if ( W == NULL )
  41.       {
  42.       /* the window wasnt opend */
  43.       exit (FALSE);
  44.       }
  45.  
  46.    PrintIText ( W->RPort, &text, 5,10 );
  47.  
  48.    Wait ( 1<<W->UserPort->mp_SigBit );
  49.  
  50.    CloseWindow ( W );
  51.  
  52.    CloseLibrary ( IntuitionBase );
  53.  
  54.    exit(TRUE);
  55.  
  56. }
  57.  
  58.