HelloMac.pp 556 B

12345678910111213141516171819202122232425262728293031323334353637
  1. {$MODE MACPAS}
  2. {$APPTYPE GUI}
  3. program HelloMac;
  4. {Demo of a simple program which uses the classic Macintosh Toolbox.
  5. It also shows how to include a mac style resource file.}
  6. USES
  7. MacOS;
  8. {$R HelloMac.r}
  9. var
  10. window: WindowPtr;
  11. begin
  12. InitGraf(@qd.thePort);
  13. InitFonts;
  14. InitWindows;
  15. InitMenus;
  16. TEInit;
  17. InitDialogs(nil);
  18. InitCursor;
  19. window:= GetNewWindow(128, nil, WindowPtr(-1));
  20. if window <> nil then
  21. begin
  22. SetPort(window);
  23. MoveTo(20,20);
  24. DrawString('Hello Free Pascal on the Mac :-)');
  25. repeat
  26. until Button;
  27. end;
  28. end.