Basic repl
This commit is contained in:
commit
ecbfce64ed
20 changed files with 565 additions and 0 deletions
7
editor/Cargo.toml
Normal file
7
editor/Cargo.toml
Normal file
|
@ -0,0 +1,7 @@
|
|||
[package]
|
||||
name = "editor"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
floem = "0.2.0"
|
18
editor/src/main.rs
Normal file
18
editor/src/main.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
use floem::{prelude::*, style::Style};
|
||||
|
||||
fn main() {
|
||||
floem::launch(counter_view);
|
||||
}
|
||||
|
||||
fn counter_view() -> impl IntoView {
|
||||
let mut counter = RwSignal::new(20);
|
||||
v_stack({
|
||||
label("test")
|
||||
}).style(Style::d);
|
||||
h_stack((
|
||||
button("Increment").action(move || counter += 1),
|
||||
label(move || format!("Value: {counter}")),
|
||||
button("Decrement").action(move || counter -= 1),
|
||||
))
|
||||
.style(|s| s.size_full().items_center().justify_center().gap(10))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue