home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / MUI / MUIBuilder22.lha / MUIBuilder / MB / C / Examples / MUIB-Demo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-26  |  1.2 KB  |  60 lines

  1. /* Libraries */
  2. #include <libraries/mui.h>
  3.  
  4. /* protos */
  5. #include <clib/muimaster_protos.h>
  6. #include <clib/alib_protos.h>
  7. #include <clib/dos_protos.h>
  8. #include <clib/exec_protos.h>
  9.  
  10. /*  Pragmas  */
  11. #include <pragmas/muimaster_pragmas.h>
  12. #include <pragmas/exec_pragmas.h>
  13.  
  14. /*  Ansi  */
  15. #include <stdlib.h>
  16. #include <stdio.h>
  17.  
  18. /* MUIBuilder */
  19. #include "MUIB-DemoGui.h"
  20.  
  21. struct Library * MUIMasterBase;
  22.  
  23. /* Init function */
  24. static void init( void )
  25. {
  26.     if (!(MUIMasterBase = OpenLibrary(MUIMASTER_NAME,MUIMASTER_VMIN)))
  27.     {
  28.         printf("Can't Open MUIMaster Library");
  29.         exit(20);
  30.     }
  31. }
  32.  
  33. /* main function */
  34. main()
  35. {
  36.     struct ObjApp * App = NULL;    /* Application object */
  37.     BOOL    running = TRUE;
  38.     ULONG    signal;
  39.  
  40.     /* Program initialisation ( you need to write it yourself) */
  41.     init();
  42.  
  43.     /* Create Application : generated by MUIBuilder */
  44.     App = CreateApp();
  45.  
  46.     while (running)
  47.         {
  48.                 switch (DoMethod(App->App,MUIM_Application_Input,&signal))
  49.                 {
  50.                 case MUIV_Application_ReturnID_Quit:
  51.                         running = FALSE;
  52.                         break;
  53.                 }
  54.     if (running && signal) Wait(signal);
  55.         }
  56.     DisposeApp(App);
  57.     CloseLibrary(MUIMasterBase);
  58.     exit(0);
  59. }
  60.