home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / MUI / MUIBuilder22.lha / MUIBuilder / MB / GCC / example / MUIB-Demo.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-31  |  686 b   |  43 lines

  1.  
  2. #include <stdio.h>
  3. #include "MUIB-DemoGui.h"
  4.  
  5. struct Library *MUIMasterBase;
  6.  
  7. int main()
  8. {
  9.   ULONG    signals;
  10.   BOOL    running = TRUE;
  11.   struct ObjApp *app;
  12.  
  13.   if (!(MUIMasterBase = OpenLibrary(MUIMASTER_NAME,MUIMASTER_VMIN)))
  14.   {
  15.     puts("Failed to open "MUIMASTER_NAME".");
  16.     exit(1);
  17.   }  
  18.  
  19.   app = CreateApp();
  20.   if (!app) 
  21.   {
  22.     puts("Failed to create Application.");
  23.     exit(1);
  24.   }  
  25.  
  26.   while (running)
  27.   {
  28.     switch (DoMethod(app->App,MUIM_Application_Input,&signals))
  29.     {
  30.       case MUIV_Application_ReturnID_Quit:
  31.         running = FALSE;
  32.         break;
  33.     }
  34.     if (running && signals) Wait(signals);
  35.   }
  36.  
  37.   DisposeApp(app);
  38.  
  39.   if (MUIMasterBase) CloseLibrary(MUIMasterBase);
  40.  
  41. }
  42.  
  43.