1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Fix up some examples (#3614)

This commit is contained in:
Emil Ernerfeldt
2023-11-23 12:58:44 +01:00
committed by GitHub
parent a2b15b23ad
commit 24913ceeba
17 changed files with 123 additions and 82 deletions

View File

@@ -6,7 +6,10 @@ fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
if cfg!(target_os = "macos") {
eprintln!("WARNING: this example does not work on Mac! See https://github.com/emilk/egui/issues/1918");
eprintln!(
"This example does not work on Mac! See https://github.com/emilk/egui/issues/1918"
);
return Ok(());
}
let options = eframe::NativeOptions {
@@ -54,6 +57,11 @@ impl eframe::App for MyApp {
"This is the last window. Program will end when closed"
};
ui.label(label_text);
if ctx.os() == egui::os::OperatingSystem::Mac {
ui.label("This example doesn't work on Mac!");
}
if ui.button("Close").clicked() {
eprintln!("Pressed Close button");
ui.ctx().send_viewport_cmd(egui::ViewportCommand::Close);