summaryrefslogtreecommitdiff
path: root/objectio/tut7_2_2.icl
diff options
context:
space:
mode:
authorCamil Staps2015-08-08 19:58:36 +0200
committerCamil Staps2015-08-08 19:58:36 +0200
commit062cf91937b0a82254caf27b4e19c23abfeea86d (patch)
tree30096fd5aea8546d85ebec8b95d24708aa08077f /objectio/tut7_2_2.icl
parentUsing pointers (diff)
ObjectIO tests
Diffstat (limited to 'objectio/tut7_2_2.icl')
-rw-r--r--objectio/tut7_2_2.icl18
1 files changed, 18 insertions, 0 deletions
diff --git a/objectio/tut7_2_2.icl b/objectio/tut7_2_2.icl
new file mode 100644
index 0000000..57d5e56
--- /dev/null
+++ b/objectio/tut7_2_2.icl
@@ -0,0 +1,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" ]