home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / luschsrc.sit / about.c next >
Text File  |  1990-05-23  |  1KB  |  61 lines

  1. /********************************************************************************
  2.  *    about.c
  3.  *
  4.  *    About Dialog Package
  5.  *
  6.  *    Written by Paco Xander Nathan
  7.  *    ⌐1990, Motorola Inc.  Public domain source code.
  8.  ********************************************************************************/
  9.  
  10. #include "applic.h"
  11. #include "window.h"
  12. #include "dialog.h"
  13. #include "string.h"
  14. #include "noise.h"
  15. #include "help.h"
  16. #include "about.h"
  17.  
  18.  
  19. typedef enum {
  20.     aboutIcon = 1, aboutText, aboutName, aboutMoto
  21. } aboutItems;
  22.  
  23.  
  24. /* Put up the About dialog
  25.  */
  26. void
  27. AboutAppl ()
  28. {
  29.     Str255 theName;
  30.     short kind;
  31.     Handle theItem;
  32.     Rect bounds;
  33.     
  34.     if (!dPtrAbout) {
  35.         dPtrAbout = DlogWindow(aboutDlogID);
  36.  
  37.         if ((StrGetChooser(theName) == noErr) && (theName[0] > 0)) {
  38.             GetDItem(dPtrAbout, aboutName, &kind, &theItem, &bounds);
  39.             SetIText(theItem, theName);
  40.         }
  41.     }
  42.     else
  43.         WindSwitch(dPtrAbout, TRUE);
  44. }
  45.  
  46.  
  47. /* Handle user events within the About dialog
  48.  */
  49. void
  50. AboutEvent (itemNum)
  51.     register short itemNum;
  52.  {
  53.     switch (itemNum) {
  54.     case aboutIcon:
  55.         NoisePlay(noisePaco);
  56.         break;
  57.  
  58.     default:
  59.         break;
  60.     }
  61. }