cedar
is a functional-reactive GUI library.
Status: cedar
is in the alpha stage and currently only supports macOS (cocoa)
- not yet ready for prime-time.
Add this to Cargo.toml
:
[dependencies]
cedar = { git = "https://github.com/jtomschroeder/cedar" }
and this to the root of your crate:
extern crate cedar;
extern crate cedar;
type Model = i32;
enum Message {
Increment,
Decrement,
}
fn update(model: &Model, message: Message) -> Model {
match message {
Message::Increment => model + 1,
Message::Decrement => model - 1,
}
}
fn view() -> cedar::View<Model, Message> {
cedar::View::new()
.button(|button| {
button.text("+")
.click(|| Message::Increment)
})
.label(|label| label.text(Model::to_string))
.button(|button| {
button.text("-")
.click(|| Message::Decrement)
})
}
fn main() {
cedar::Program::new(0, update, view).run()
}
A cedar
application is composed of a model, update, and view.
Inspired by:
cedar
is Copyright © Tom Schroeder j.tom.schroeder@gmail.com and released under MIT license.