home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Assembler / dse-src5.dms / in.adf / CustomScreen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-07  |  2.2 KB  |  125 lines

  1. /*******************************************************************x****
  2.  * This "C" program create a Custom Screen with a simple Window in it! *
  3.  * To compile this program in Aztec C68K you must compile with 32 Bit, *
  4.  * instead of 16 Bit.                                                  *
  5.  ***********************************************************************/
  6.  
  7. #include <exec/types.h>
  8. #include <intuition/intuition.h>
  9.  
  10. struct Intuition *IntuitionBase;
  11. struct GfxBase *GfxBase;
  12.  
  13. #define INTUITION_REV  29
  14. #define GRAPHICS_REV   29
  15.  
  16. struct TextAttr MyFont =
  17.    {
  18.        "topaz.font",
  19.        TOPAZ_EIGHTY,
  20.    };
  21. struct NewScreen NewScreen =
  22.    {
  23.        0,
  24.        0,
  25.        320,
  26.        256,
  27.        2,
  28.        0, 1,
  29.        NULL,
  30.        CUSTOMSCREEN,
  31.        &MyFont,
  32.        "A Simple Custom Screen...",
  33.        NULL,
  34.        NULL,
  35.    };
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. main()
  75. {
  76.    struct Screen *Screen;
  77.    struct NewWindow NewWindow;
  78.    struct Window *Window;
  79.  
  80.    LONG i;
  81.  
  82.    IntuitionBase = (struct IntuitionBase *)
  83.       OpenLibrary("intuition.library", INTUITION_REV);
  84.    if (IntuitionBase == NULL)
  85.       exit(FALSE);
  86.  
  87.    GfxBase = (struct GfxBase *)OpenLibrary("graphics.library",GRAPHICS_REV);
  88.    if (GfxBase == NULL)
  89.       exit(FALSE);
  90.   
  91.    if ((Screen = (struct Screen *)OpenScreen(&NewScreen)) == NULL)
  92.       exit(FALSE);
  93.  
  94.    NewWindow.LeftEdge = 0;
  95.    NewWindow.TopEdge = 11;
  96.    NewWindow.Width = 250;
  97.    NewWindow.Height = 100;
  98.    NewWindow.DetailPen = 0;
  99.    NewWindow.BlockPen = 1;
  100.    NewWindow.Title = "Use Kickstart 1.2";
  101.    NewWindow.Flags = WINDOWCLOSE|SMART_REFRESH|ACTIVATE
  102.                      |WINDOWSIZING|WINDOWDRAG|WINDOWDEPTH;
  103.    NewWindow.IDCMPFlags = CLOSEWINDOW;
  104.    NewWindow.Type = CUSTOMSCREEN;
  105.    NewWindow.FirstGadget = NULL;
  106.    NewWindow.CheckMark = NULL;
  107.    NewWindow.Screen = Screen;
  108.    NewWindow.BitMap = NULL;
  109.    NewWindow.MinWidth = 202;
  110.    NewWindow.MinHeight = 26;
  111.    NewWindow.MaxWidth = 640;
  112.    NewWindow.MaxHeight = 256;
  113.  
  114.    if (( Window = (struct Window *)OpenWindow(&NewWindow) ) == NULL)
  115.       exit(FALSE);
  116.  
  117.    Move(Window->RPort, 20, 20);
  118.    Text(Window->RPort, "     HELLO     ", 15);
  119.  
  120.    Wait(1 << Window->UserPort->mp_SigBit);
  121.    CloseWindow(Window);
  122.    CloseScreen(Screen);
  123.    exit(TRUE);
  124. }
  125.