diff options
-rw-r--r-- | objectio/drawingframe.icl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/objectio/drawingframe.icl b/objectio/drawingframe.icl new file mode 100644 index 0000000..1f6c8db --- /dev/null +++ b/objectio/drawingframe.icl @@ -0,0 +1,28 @@ +module drawingframe + +// ******************************************************************************** +// Clean tutorial example program. +// +// This program defines a framework in which one can test drawing functions. +// The program relies on a function, example, of type *Picture -> *Picture. +// ******************************************************************************** + +import StdEnv, StdIO + +Start :: *World -> *World +Start world = startIO SDI Void (snd o openWindow Void testwindow) [ProcessClose closeProcess] world + +testwindow = Window "Test Drawing" NilLS [ + WindowViewSize size, + WindowClose (noLS closeProcess), + WindowLook True (\_ _->example), + WindowViewDomain {corner1=origin,corner2=maxdomain} + ] +where + size = {w=200,h=50} + origin = {x=(-20),y=(-20)} + maxdomain = {x=origin.x+size.w,y=origin.y+size.h} + +// Here, example draws the string "Pop" at zero +example = drawAt zero "Pop" + |