Print stack in gui

This commit is contained in:
Austen Adler 2023-04-14 02:21:05 -04:00
parent d935cf6101
commit 8346412f7a

View File

@ -112,10 +112,6 @@ impl eframe::App for TemplateApp {
"Source code." "Source code."
)); ));
// ui.label(ui.input(|i| {
// format!("Keys pressed: {:?}", i.key_pressed(egui::Key::I) )
// }));
ui.input(|i| { ui.input(|i| {
if i.events.is_empty() { if i.events.is_empty() {
return; return;
@ -180,13 +176,16 @@ impl eframe::App for TemplateApp {
egui::Event::AccessKitActionRequest(_) => continue, 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::<Vec<_>>()
.join("\n"));
// ui.label(format!("Calc details: {:#?}", self.calculator.stack));
ui.label(format!("Entry buffer: {}", self.calculator.get_l())); ui.label(format!("Entry buffer: {}", self.calculator.get_l()));
egui::warn_if_debug_build(ui); egui::warn_if_debug_build(ui);