aboutsummaryrefslogtreecommitdiff
path: root/tut7_2_2.icl
blob: 57d5e56858e8c2f0a5bcba1909a4f84aef925b96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module tut7_2_2

import StdEnv, StdIO

Start :: *World -> *World
Start world = startIO NDI Void initialise [] world
where
    initialise pst
    # (error,pst)       = openDialog Void dialog pst
    | error <> NoError  = closeProcess pst
    | otherwise         = pst

    dialog = Dialog "ObjectIO" controls [WindowClose (noLS closeProcess)]

    controls = ListLS [ TextControl label [ControlWidth (ContentWidth maxlabel), ControlPos (Left, zero)] :+: EditControl "" (PixelWidth 100) 1 [] \\ label <- labels]
    maxlength = maxList (map size labels)
    maxlabel = hd (dropWhile (\l . size l <> maxlength) labels)
    labels = [ "Short label" , "Long and too verbose label" , "Medium length label" ]