roc/examples/gui/hello-guiBROKEN.roc
Agus Zubiaga 8dedd9f03c
New app header syntax
Implements the new app header syntax as discussed in Zulip [1].

    app [main] {
	cli: platform "../platform/main.roc",
	json: "../json/main.roc"
    }

Old headers still parse and are automatically upgraded to the new
syntax by the formatter.

[1] 418444862
2024-05-01 10:49:01 -03:00

17 lines
720 B
Text

app # [pf.Action.{ Action }, pf.Elem.{ button, text, row, col }]
[render] { pf: platform "platform/main.roc" }
render =
rgba = \r, g, b, a -> { r: r / 255, g: g / 255, b: b / 255, a }
styles = { bgColor: rgba 100 50 50 1, borderColor: rgba 10 20 30 1, borderWidth: 10, textColor: rgba 220 220 250 1 }
Col [
Row [
Button (Text "Corner ") styles,
Button (Text "Top Mid ") { styles & bgColor: rgba 100 100 50 1 },
Button (Text "Top Right ") { styles & bgColor: rgba 50 50 150 1 },
],
Button (Text "Mid Left ") { styles & bgColor: rgba 150 100 100 1 },
Button (Text "Bottom Left") { styles & bgColor: rgba 150 50 50 1 },
]