Mercurial > gui
comparison examples/togglepanel.ur @ 20:554e342665fe
Add a new parameter to Gui.gui
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 24 Sep 2011 15:47:00 -0400 |
parents | 90be8b8917d5 |
children | 93140c5cc972 |
comparison
equal
deleted
inserted
replaced
19:3a303df9ae92 | 20:554e342665fe |
---|---|
2 open TogglePanel | 2 open TogglePanel |
3 | 3 |
4 val defaultContent : xbody = <xml><p>Here I am inside the panel.<br/><b>Default format</b></p></xml> | 4 val defaultContent : xbody = <xml><p>Here I am inside the panel.<br/><b>Default format</b></p></xml> |
5 val otherContent : xbody = <xml><p>Here I am inside the panel.<br/><b>Other format</b></p></xml> | 5 val otherContent : xbody = <xml><p>Here I am inside the panel.<br/><b>Other format</b></p></xml> |
6 | 6 |
7 val otherFormat = {FormatPanel = fn ctl panel => <xml><span>A Custom {ctl} Format</span>{panel}</xml>, | 7 val otherFormat = fn [body ~ []] => |
8 OpenCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>View</a></xml>, | 8 {FormatPanel = fn ctl panel => <xml><span>A Custom {ctl} Format</span>{panel}</xml>, |
9 CloseCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>Hide</a></xml>} | 9 OpenCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>View</a></xml>, |
10 CloseCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>Hide</a></xml>} | |
10 | 11 |
11 fun main () = | 12 fun main () = |
12 | 13 |
13 defaultFormatPanel <- create defaultFormat defaultContent True; | 14 defaultFormatPanel <- create @defaultFormat defaultContent True; |
14 otherFormatPanel <- create otherFormat otherContent False; | 15 otherFormatPanel <- create @otherFormat otherContent False; |
15 | 16 |
16 return <xml> | 17 return <xml> |
17 <head> | 18 <head> |
18 <title>A panel that can be shown or hidden.</title> | 19 <title>A panel that can be shown or hidden.</title> |
19 </head> | 20 </head> |