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 /support_button.icl |
ObjectIO tests
Diffstat (limited to 'support_button.icl')
-rw-r--r-- | support_button.icl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/support_button.icl b/support_button.icl new file mode 100644 index 0000000..973cf72 --- /dev/null +++ b/support_button.icl @@ -0,0 +1,33 @@ +module support_button + +import StdEnv, StdIO + +Start :: *World -> *World +Start world +# (id, world) = openId world +# buttons = [ + ButtonControl "Function" [ControlFunction (count 1 id)], + ButtonControl "Hide" [ControlHide], + ButtonControl "Id + Width" [ControlId id, ControlWidth (PixelWidth 250)], + ButtonControl "ModsFunction" [ControlModsFunction (modf id)], + ButtonControl "Pos" [ControlPos (Left, zero)], + ButtonControl "SelectState" [ControlSelectState Able], + ButtonControl "SelectState" [ControlSelectState Unable], + ButtonControl "Tip" [ControlTip "Some tip"], + ButtonControl "Width" [ControlWidth (PixelWidth 250)] + ] +# controls = ListLS buttons +# hello = Dialog "Support - ButtonControl" controls [WindowClose (noLS closeProcess)] += startIO NDI Void (initialise hello) [] world +where + initialise hello pst + # (error,pst) = openDialog 0 hello pst + | error <> NoError = closeProcess pst + | otherwise = pst + + count :: Int Id (Int, PSt .l) -> (Int, PSt .l) + count dx id (count,pst=:{io}) = (count + dx, appPIO (setControlText id (toString (count+dx))) pst) + + modf :: Id Modifiers -> (Int, PSt .l) -> (Int, PSt .l) + modf id mods = \(count,pst=:{io}) . (count, appPIO (setControlText id (toString mods)) pst) + |