2021-10-11 18:11:48 +00:00
|
|
|
// Copyright (c) Jon Thysell <http://jonthysell.com>
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
2021-10-14 00:44:08 +00:00
|
|
|
#include "MacCommon.h"
|
|
|
|
#include "MacLO.h"
|
2021-10-11 18:11:48 +00:00
|
|
|
|
2021-10-14 00:44:08 +00:00
|
|
|
void InitToolBox()
|
2021-10-11 18:11:48 +00:00
|
|
|
{
|
|
|
|
InitGraf(&thePort);
|
|
|
|
InitFonts();
|
|
|
|
InitWindows();
|
|
|
|
InitMenus();
|
|
|
|
TEInit();
|
2021-10-14 00:44:08 +00:00
|
|
|
InitDialogs(nil);
|
2021-10-11 18:11:48 +00:00
|
|
|
FlushEvents(everyEvent, 0);
|
|
|
|
InitCursor();
|
|
|
|
}
|
|
|
|
|
|
|
|
void InitMainWindow()
|
|
|
|
{
|
2021-10-14 00:44:08 +00:00
|
|
|
WindowPtr window;
|
|
|
|
|
|
|
|
window = GetNewWindow(kBaseResID, nil, kMoveToFront);
|
|
|
|
|
|
|
|
if (window == nil)
|
|
|
|
{
|
|
|
|
SysBeep(0);
|
|
|
|
ExitToShell();
|
|
|
|
}
|
|
|
|
|
|
|
|
ShowWindow(window);
|
|
|
|
SetPort(window);
|
|
|
|
|
2021-10-11 18:11:48 +00:00
|
|
|
MoveTo(30, 50);
|
|
|
|
DrawString("\pHello MacLO");
|
|
|
|
}
|
|
|
|
|
2021-10-14 00:44:08 +00:00
|
|
|
void ProcessEvents()
|
2021-10-11 18:11:48 +00:00
|
|
|
{
|
|
|
|
while (!Button()) { }
|
|
|
|
}
|
|
|
|
|