From d075b4831a10db83840c5e2fd11fb2b59722adfc Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sat, 8 Aug 2015 19:58:36 +0200 Subject: ObjectIO tests --- tut6_4_4.icl | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tut6_4_4.icl (limited to 'tut6_4_4.icl') diff --git a/tut6_4_4.icl b/tut6_4_4.icl new file mode 100644 index 0000000..1e7f4d8 --- /dev/null +++ b/tut6_4_4.icl @@ -0,0 +1,34 @@ +module tut6_4_4 + +// ******************************************************************************** +// Clean tutorial example program. +// +// This program creates a window that displays a user selected bitmap. +// Make sure that this application has sufficient heap or extra memory. +// ******************************************************************************** + +import StdIO, StdEnv + +Start :: *World -> *World +Start world + # (maybeFile,world) = selectInputFile world + | isNothing maybeFile + = world + # bitmapfile = fromJust maybeFile + # (maybeBitmap,world) = openBitmap bitmapfile world + | isNothing maybeBitmap + = world + | otherwise + # bitmap = fromJust maybeBitmap + bitmapsize = getBitmapSize bitmap + window = Window "Bitmap" NilLS + [ WindowViewSize bitmapsize + , WindowLook True (\_ _->drawAt zero bitmap) + , WindowClose (noLS closeProcess) + ] + = startIO SDI + Void + (snd o openWindow Void window) + [ProcessClose closeProcess] + world + -- cgit v1.2.3