comparison gui.urs @ 23:7c734edc6301

Merge from Adam.
author Karn Kallio <kkallio@eka>
date Sat, 24 Sep 2011 18:55:27 -0430
parents 554e342665fe
children 5905b56e0cd9
comparison
equal deleted inserted replaced
22:4362b15220e4 23:7c734edc6301
1 (* Gui framework elements common across individual components. *) 1 (* Gui framework elements common across individual components. *)
2 2
3 class gui
4 (* Types of this class describe gui components. *) 3 (* Types of this class describe gui components. *)
4 class gui :: Type (* The type of an object to render *)
5 -> {Unit} (* The HTML context to render it for (minus [body]) *)
6 -> Type
5 7
6 val toXml : t ::: Type -> gui t -> t -> xbody 8 (* How to add components to the gui class. *)
9 val mkGui : t ::: Type -> ctx ::: {Unit} -> ([body ~ ctx] => t -> xml (body ++ ctx) [] []) -> gui t ctx
10
11 (* XML itself can be a gui component. *)
12 val gui_xbody : gui xbody []
13 val gui_xtable : gui xtable [Table]
14
7 (* Currently the only thing a gui component can do is be 15 (* Currently the only thing a gui component can do is be
8 * pretty printed to a piece of xml. *) 16 * pretty printed to a piece of xml. *)
9 17 val toXml : t ::: Type -> ctx ::: {Unit} -> [body ~ ctx] => gui t ctx -> t -> xml (body ++ ctx) [] []
10 val gui_xbody : gui xbody
11 (* Xml itself can be a gui component. *)
12
13 val mkGui : t ::: Type -> (t -> xbody) -> gui t
14 (* How to add components to the gui class. *)