This commit is contained in:
2025-11-20 23:23:01 +01:00
parent b57fffe9b7
commit 0cefbaa223
2 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ use osui::prelude::*;
fn main() { fn main() {
let mut cx = Context::new(app); let mut cx = Context::new(app);
cx.refresh(); cx.refresh();
// println!("{:?}", cx.get_nodes()); println!("{:?}", cx.get_nodes());
} }
fn app(cx: &mut Context) -> Vec<Node> { fn app(cx: &mut Context) -> Vec<Node> {
+13
View File
@@ -14,3 +14,16 @@ pub enum Node {
String(Arc<dyn Fn() -> String>), String(Arc<dyn Fn() -> String>),
Component(component::Component), Component(component::Component),
} }
impl std::fmt::Debug for Node {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
Self::Component(_) => format!("Component"),
Self::String(v) => format!("String({})", v()),
}
)
}
}