Mercurial > gui
diff togglePanel.ur @ 18:16447dc6a68c
Introduction of multi-parameter type class for gui components
author | Ron de Bruijn <rmbruijn@gmail.com> |
---|---|
date | Thu, 22 Sep 2011 19:24:01 +0200 |
parents | 90be8b8917d5 |
children | 3a303df9ae92 |
line wrap: on
line diff
--- a/togglePanel.ur Sun Aug 21 11:27:41 2011 -0400 +++ b/togglePanel.ur Thu Sep 22 19:24:01 2011 +0200 @@ -14,14 +14,14 @@ open Gui -fun create [t ::: Type] (toXml : gui t) (f : formatCtl) (content : t) (startOpen : bool) : transaction (togglePanel t) = +fun create [t ::: Type] (toXml : gui t xbody) (f : formatCtl) (content : t) (startOpen : bool) : transaction (togglePanel t) = state <- source (if startOpen then Open else Closed); return {PanelState = state, FormatCtl = f, Content = content} -fun render [t ::: Type] (_ : gui t) (panel : togglePanel t) = +fun render [t ::: Type] (_ : gui t xbody) (panel : togglePanel t) = let val openCtl = panel.FormatCtl.CloseCtl (set panel.PanelState Closed) val closeCtl = panel.FormatCtl.OpenCtl (set panel.PanelState Open) @@ -48,4 +48,4 @@ </xml> end -fun gui_togglePanel [t ::: Type] (_ : gui t) = mkGui render +fun gui_togglePanel [t ::: Type] (_ : gui t xbody) = mkGui render