From bd09b8109462220227c845b0d9cbb7a2a208e76f Mon Sep 17 00:00:00 2001 From: olle Date: Tue, 22 Feb 2005 22:17:32 +0000 Subject: [PATCH] + First demo for macos toolbox --- demo/macos/HelloMac.pp | 37 +++++++++++++++++++++++++++++++++++++ demo/macos/HelloMac.r | 5 +++++ 2 files changed, 42 insertions(+) create mode 100644 demo/macos/HelloMac.pp create mode 100644 demo/macos/HelloMac.r diff --git a/demo/macos/HelloMac.pp b/demo/macos/HelloMac.pp new file mode 100644 index 0000000000..97fe838cb9 --- /dev/null +++ b/demo/macos/HelloMac.pp @@ -0,0 +1,37 @@ +{$MODE MACPAS} +{$APPTYPE GUI} + +program HelloMac; + +{Demo of a simple program which uses the classic Macintosh Toolbox. + It also shows how to include a mac style resource file.} + +USES + MacOS; + +{$R HelloMac.r} + +var + window: WindowPtr; + +begin + InitGraf(@qd.thePort); + InitFonts; + InitWindows; + InitMenus; + TEInit; + InitDialogs(nil); + InitCursor; + + window:= GetNewWindow(128, nil, WindowPtr(-1)); + if window <> nil then + begin + SetPort(window); + MoveTo(20,20); + DrawString('Hello Free Pascal on the Mac :-)'); + + repeat + until Button; + end; + +end. diff --git a/demo/macos/HelloMac.r b/demo/macos/HelloMac.r new file mode 100644 index 0000000000..0a80ea2f09 --- /dev/null +++ b/demo/macos/HelloMac.r @@ -0,0 +1,5 @@ +data 'WIND' (128) { + $"0040 0027 00D0 0131 0000 0100 0000 0000" + $"0000 0848 656C 6C6F 4D61 63" +}; +