home *** CD-ROM | disk | FTP | other *** search
- #include "headers.h"
- #include "menus.h"
- #include "Protos.h"
- #include "CContainer.h"
- #include "CSimpleAppSite.h"
- #include "App.h"
-
- AppData gAppData = { NULL };
-
- static void SetupMenus(void);
-
- void Initialize(void)
- /*
- Initialize Mac Tools and application values
- */
- {
- short i;
-
- InitGraf((Ptr) &qd.thePort); /* Mac Tool Initializition */
- InitFonts();
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(0L);
- InitCursor();
-
- MaxApplZone(); /* allocate master handles */
- for (i=1; i<=10; ++i)
- MoreMasters();
-
- SetupMenus();
-
- gAppData.Window = GetNewCWindow(128, NULL, (WindowPtr) -1);
- #ifdef USE_OFFSCREEN
- NewGWorld(&gAppData.Offscreen, 0, &gAppData.Window->portRect, NULL, NULL, 0);
- #endif // USE_OFFSCREEN
- SetPort(gAppData.Window);
-
- InitApp(&gAppData);
- }
-
- void SetupMenus(void)
- /*
- read a menubar from the resource fork and make it the current menu.
- */
- {
- Handle menuBar;
-
- /* Add the menu bar
- */
- menuBar = GetNewMBar(rMenuBar); /*read menus into menu bar*/
- SetMenuBar(menuBar); /*install menus*/
- DisposHandle((Handle) menuBar);
-
- AddResMenu(GetMHandle(mApple), 'DRVR'); /*add DA names to Apple menu*/
-
- DrawMenuBar();
-
- }
-
-