home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- * initialize.c
- *
- * Initialization routines.
- *
- *
- * Author: Rob Johnston
- * Date: Tuesday, February 25, 1992
- *
- * Copyright © 1992 Apple Computer, Inc.
- *
- */
-
- #include <Drag.h>
- #include <GestaltEqu.h>
- #include "globals.h"
- #include "resources.h"
-
-
- void InitializeToolbox()
-
- { long gestaltResponse;
-
- InitGraf(&thePort);
- InitFonts();
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(0L);
- InitCursor();
-
- MoreMasters();
- MoreMasters();
- MaxApplZone();
-
- FlushEvents(everyEvent, 0);
-
- if ((Gestalt(gestaltDragMgrAttr, &gestaltResponse) != noErr) ||
- (!(gestaltResponse & (1 << gestaltDragMgrPresent)))) {
-
- Alert(512, 0L);
- ExitToShell();
- }
- }
-
-
- void InitializeGlobals()
-
- { Handle theHandle;
-
- gQuit = gQuitting = false;
- gDocumentCount = 0;
- gFontItem = gSizeItem = 0;
- gInBackground = false;
- gCanUndoDrag = slCantUndo;
- }
-
-
- void DeallocateGlobals()
-
- {
-
- }
-
-
- void SetupMenus()
-
- { Handle theMenuBar;
- MenuHandle theMenu;
- Str255 theStr;
-
- if (! (theMenuBar = GetNewMBar(MenuBarID))) {
- SysBeep(1);
- ExitToShell();
- }
- SetMenuBar(theMenuBar);
- DisposHandle(theMenuBar);
-
- AddResMenu(GetMHandle(idAppleMenu), 'DRVR');
- AddResMenu(GetMHandle(idFontMenu), 'FONT');
-
- GetIndString(theStr, MenuStringsID, slCantUndo);
- SetItem(GetMHandle(idEditMenu), iUndo, theStr);
-
- DrawMenuBar();
- }
-
-