summaryrefslogtreecommitdiff
path: root/objectio/drawingframe.icl
blob: 1f6c8dbd02810474b8e5dbc61f8499f7762b4f67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"