home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Snippets / Background ppat 1.0.2 / src / apple.c next >
Encoding:
C/C++ Source or Header  |  1995-12-15  |  1.4 KB  |  72 lines  |  [TEXT/CWIE]

  1. /* ----------------------------------------------------------------------
  2. apple.c
  3. ---------------------------------------------------------------------- */
  4.  
  5. #include    "main.h"
  6. #include    "apple.h"
  7.  
  8. /* ----------------------------------------------------------------------
  9. DoMenuApple
  10. ---------------------------------------------------------------------- */
  11. void DoMenuApple(theItem)
  12. int theItem;
  13. {
  14.     switch (theItem)
  15.     {
  16.         case APPLE_ABOUT:
  17.             AppleAbout();
  18.             break;
  19.         default:
  20.             AppleDA(theItem);
  21.             break;
  22.     }
  23.     
  24. }
  25.  
  26. /* ----------------------------------------------------------------------
  27. AppleAbout
  28. ---------------------------------------------------------------------- */
  29. void AppleAbout()
  30. {
  31.     DialogPtr myDialog;
  32.     short    itemHit;
  33.     Boolean aboutDone = false;
  34.     Boolean modaling;
  35.  
  36.     myDialog = GetNewDialog(DLOG_ABOUT,0,(WindowPtr) -1);
  37.     if (myDialog)
  38.     {
  39.         do
  40.         {
  41.             ShowWindow(myDialog);
  42.             ModalDialog(NIL,&itemHit);
  43.             switch(itemHit)
  44.             {
  45.                 case DLOG_ABOUT_OK:
  46.                     aboutDone = true;
  47.                     break;
  48.                 case DLOG_ABOUT_PICT:
  49.                     aboutDone = true;
  50.                     break;
  51.             }
  52.         }
  53.         while (!aboutDone);
  54.         DisposeDialog(myDialog);
  55.         DoUpdate();
  56.     }
  57. }
  58.  
  59. /* ----------------------------------------------------------------------
  60. AppleDA
  61. ---------------------------------------------------------------------- */
  62. void AppleDA(theItem)
  63. int theItem;
  64. {
  65.     Str255    accName;
  66.     int        accNumber;
  67.  
  68.     GetItem(gAppleMenu,theItem,accName);
  69.     accNumber = OpenDeskAcc(accName);
  70.  
  71. }
  72.