home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / System Extensions / Macintosh Drag and Drop 1.1.1 / Demo Applications / DragText Sources / initialize.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-15  |  1.3 KB  |  89 lines  |  [TEXT/KAHL]

  1. /*
  2.  *
  3.  *        initialize.c
  4.  *
  5.  *        Initialization routines.
  6.  *        
  7.  *
  8.  *        Author:        Rob Johnston
  9.  *        Date:        Tuesday, February 25, 1992
  10.  *
  11.  *        Copyright © 1992 Apple Computer, Inc.
  12.  *
  13.  */
  14.  
  15. #include <Drag.h>
  16. #include <GestaltEqu.h>
  17. #include "globals.h"
  18. #include "resources.h"
  19.  
  20.  
  21. void InitializeToolbox()
  22.  
  23. {    long            gestaltResponse;
  24.  
  25.     InitGraf(&thePort);
  26.     InitFonts();
  27.     InitWindows();
  28.     InitMenus();
  29.     TEInit();
  30.     InitDialogs(0L);
  31.     InitCursor();
  32.  
  33.     MoreMasters();
  34.     MoreMasters();
  35.     MaxApplZone();
  36.  
  37.     FlushEvents(everyEvent, 0);
  38.  
  39.     if ((Gestalt(gestaltDragMgrAttr, &gestaltResponse) != noErr) ||
  40.         (!(gestaltResponse & (1 << gestaltDragMgrPresent)))) {
  41.  
  42.         Alert(512, 0L);
  43.         ExitToShell();
  44.     }
  45. }
  46.  
  47.  
  48. void InitializeGlobals()
  49.  
  50. {    Handle            theHandle;
  51.  
  52.     gQuit = gQuitting = false;
  53.     gDocumentCount = 0;
  54.     gFontItem = gSizeItem = 0;
  55.     gInBackground = false;
  56.     gCanUndoDrag = slCantUndo;
  57. }
  58.  
  59.  
  60. void DeallocateGlobals()
  61.  
  62. {
  63.     
  64. }
  65.  
  66.  
  67. void SetupMenus()
  68.  
  69. {    Handle        theMenuBar;
  70.     MenuHandle    theMenu;
  71.     Str255        theStr;
  72.  
  73.     if (! (theMenuBar = GetNewMBar(MenuBarID))) {
  74.         SysBeep(1);
  75.         ExitToShell();
  76.     }
  77.     SetMenuBar(theMenuBar);
  78.     DisposHandle(theMenuBar);
  79.  
  80.     AddResMenu(GetMHandle(idAppleMenu), 'DRVR');
  81.     AddResMenu(GetMHandle(idFontMenu), 'FONT');
  82.  
  83.     GetIndString(theStr, MenuStringsID, slCantUndo);
  84.     SetItem(GetMHandle(idEditMenu), iUndo, theStr);
  85.  
  86.     DrawMenuBar();
  87. }
  88.  
  89.