aboutsummaryrefslogtreecommitdiff
path: root/console/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'console/src/gui')
-rw-r--r--console/src/gui/controller_app.rs38
-rw-r--r--console/src/gui/mod.rs1
2 files changed, 0 insertions, 39 deletions
diff --git a/console/src/gui/controller_app.rs b/console/src/gui/controller_app.rs
deleted file mode 100644
index d8325b1..0000000
--- a/console/src/gui/controller_app.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-pub struct MyApp {
- show_hello: bool, // 控制是否显示 "Hello World!"
-}
-
-impl Default for MyApp {
- fn default() -> Self {
- Self { show_hello: false }
- }
-}
-
-impl eframe::App for MyApp {
- fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
- egui::CentralPanel::default().show(ctx, |ui| {
- // 添加一个按钮
- if ui.button("Click me!").clicked() {
- self.show_hello = !self.show_hello; // 切换状态
- }
-
- // 如果按钮被点击过,显示 "Hello World!"
- if self.show_hello {
- ui.label("Hello World!");
- }
- });
- }
-}
-
-impl MyApp {
- pub fn start () {
- let options = eframe::NativeOptions::default();
- let _ = eframe::run_native(
- "My egui App",
- options,
- Box::new(|_cc| {
- Ok(Box::<MyApp>::default())
- }),
- );
- }
-} \ No newline at end of file
diff --git a/console/src/gui/mod.rs b/console/src/gui/mod.rs
deleted file mode 100644
index 5e7124a..0000000
--- a/console/src/gui/mod.rs
+++ /dev/null
@@ -1 +0,0 @@
-pub mod controller_app; \ No newline at end of file