diff options
author | Camil Staps | 2015-08-08 19:58:36 +0200 |
---|---|---|
committer | Camil Staps | 2015-08-08 19:58:36 +0200 |
commit | d075b4831a10db83840c5e2fd11fb2b59722adfc (patch) | |
tree | 20f7d14c8318b7e09e982e8f2ca8b8722afb8348 /tut6_4_4.icl |
ObjectIO tests
Diffstat (limited to 'tut6_4_4.icl')
-rw-r--r-- | tut6_4_4.icl | 34 |
1 files changed, 34 insertions, 0 deletions
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 + |