home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 106 / EnigmaAmiga106CD.iso / software / utilities / installer / gui api / example / igui_quietwaitapp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-27  |  1.3 KB  |  63 lines

  1.  
  2. #include "includes.h"
  3. #include "installergui_data.h"
  4.  
  5. /********************************************************************
  6.  *
  7.  *  DESCRIPTION
  8.  *
  9.  */
  10.  
  11. /********************************************************************
  12.  *
  13.  *  STATIC
  14.  *
  15.  */
  16.  
  17. /********************************************************************
  18.  *
  19.  *  EXTERN
  20.  *
  21.  */
  22.  
  23. /********************************************************************
  24.  *
  25.  *  PUBLIC
  26.  *
  27.  */
  28.  
  29. /********************************************************************
  30.  *
  31.  *  CODE
  32.  *
  33.  */
  34.  
  35. long __asm igui_QuietWaitApp(register __a0 APTR application)
  36. {
  37.   #ifdef DEBUG
  38.   DEBUG_MAKRO
  39.   #endif
  40.  
  41.   {
  42.     long sigs = 0, event;
  43.     struct Application *app = (struct Application *) application;
  44.  
  45.     // wait for user input
  46.     while (TRUE)
  47.     {
  48.       DoMethod(app->app_Application, MUIM_Application_NewInput, &sigs);
  49.       if (sigs)
  50.       {
  51.         sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D | SIGBREAKF_CTRL_E);
  52.  
  53.         if (sigs & SIGBREAKF_CTRL_D) { event = GUIEVENT_PROCEED; break; }  // proceed button
  54.         if (sigs & SIGBREAKF_CTRL_E) { event = GUIEVENT_ABORT; break; }  // cancel button
  55.         if (sigs & SIGBREAKF_CTRL_C) { event = GUIEVENT_QUIT; break; }  // quit
  56.       }
  57.     }
  58.  
  59.     // give back the event
  60.     app->app_CurrentGUIEvent = event;
  61.     return(event);
  62.   }
  63. }