1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

use env_logger in all examples (#2934)

This commit is contained in:
Emil Ernerfeldt
2023-04-19 16:35:38 +02:00
committed by GitHub
parent e3a021eea6
commit ce761e548f
33 changed files with 76 additions and 37 deletions

View File

@@ -8,4 +8,7 @@ rust-version = "1.65"
publish = false
[dependencies]
eframe = { path = "../../crates/eframe" }
eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
env_logger = "0.10"

View File

@@ -1,8 +1,23 @@
use eframe::egui::{Button, CentralPanel, Context, UserAttentionType};
use eframe::{CreationContext, NativeOptions};
use eframe::{
egui::{Button, CentralPanel, Context, UserAttentionType},
CreationContext, NativeOptions,
};
use std::time::{Duration, SystemTime};
fn main() -> eframe::Result<()> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let native_options = NativeOptions {
initial_window_size: Some(eframe::egui::vec2(400., 200.)),
..Default::default()
};
eframe::run_native(
"User attention test",
native_options,
Box::new(|cc| Box::new(Application::new(cc))),
)
}
fn repr(attention: UserAttentionType) -> String {
format!("{:?}", attention)
}
@@ -116,15 +131,3 @@ impl eframe::App for Application {
ctx.request_repaint_after(Self::repaint_max_timeout());
}
}
fn main() -> eframe::Result<()> {
let native_options = NativeOptions {
initial_window_size: Some(eframe::egui::vec2(400., 200.)),
..Default::default()
};
eframe::run_native(
"User attention test",
native_options,
Box::new(|cc| Box::new(Application::new(cc))),
)
}