From 8346412f7aeb56b0898ac3446f5c3a754a59fbe5 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Fri, 14 Apr 2023 02:21:05 -0400 Subject: [PATCH] Print stack in gui --- rpn_rs_gui/src/app.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/rpn_rs_gui/src/app.rs b/rpn_rs_gui/src/app.rs index 0af6a93..3e091bb 100644 --- a/rpn_rs_gui/src/app.rs +++ b/rpn_rs_gui/src/app.rs @@ -112,10 +112,6 @@ impl eframe::App for TemplateApp { "Source code." )); - // ui.label(ui.input(|i| { - // format!("Keys pressed: {:?}", i.key_pressed(egui::Key::I) ) - // })); - ui.input(|i| { if i.events.is_empty() { return; @@ -180,13 +176,16 @@ impl eframe::App for TemplateApp { egui::Event::AccessKitActionRequest(_) => continue, } } - - eprintln!("Got events: {:#?}", i.events); - - // format!("Keys pressed: {:?}", i.keys_down) }); - ui.label(format!("Calc details: {:#?}", self.calculator.stack)); + ui.label( + self.calculator.stack.iter() + .rev() + .map(|e| e.to_string()) + .collect::>() + .join("\n")); + + // ui.label(format!("Calc details: {:#?}", self.calculator.stack)); ui.label(format!("Entry buffer: {}", self.calculator.get_l())); egui::warn_if_debug_build(ui);