mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 21:00:03 -04:00
Box the app creator (#1373)
This commit is contained in:
@@ -4,7 +4,11 @@ use eframe::egui;
|
||||
|
||||
fn main() {
|
||||
let options = eframe::NativeOptions::default();
|
||||
eframe::run_native("Confirm exit", options, |_cc| Box::new(MyApp::default()));
|
||||
eframe::run_native(
|
||||
"Confirm exit",
|
||||
options,
|
||||
Box::new(|_cc| Box::new(MyApp::default())),
|
||||
);
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
||||
@@ -15,9 +15,11 @@ use std::sync::Arc;
|
||||
|
||||
fn main() {
|
||||
let options = eframe::NativeOptions::default();
|
||||
eframe::run_native("Custom 3D painting in eframe", options, |cc| {
|
||||
Box::new(MyApp::new(cc))
|
||||
});
|
||||
eframe::run_native(
|
||||
"Custom 3D painting in eframe",
|
||||
options,
|
||||
Box::new(|cc| Box::new(MyApp::new(cc))),
|
||||
);
|
||||
}
|
||||
|
||||
struct MyApp {
|
||||
|
||||
@@ -4,9 +4,11 @@ use eframe::egui;
|
||||
|
||||
fn main() {
|
||||
let options = eframe::NativeOptions::default();
|
||||
eframe::run_native("egui example: custom font", options, |cc| {
|
||||
Box::new(MyApp::new(cc))
|
||||
});
|
||||
eframe::run_native(
|
||||
"egui example: custom font",
|
||||
options,
|
||||
Box::new(|cc| Box::new(MyApp::new(cc))),
|
||||
);
|
||||
}
|
||||
|
||||
fn setup_custom_fonts(ctx: &egui::Context) {
|
||||
|
||||
@@ -9,7 +9,7 @@ fn main() {
|
||||
eframe::run_native(
|
||||
"Download and show an image with eframe/egui",
|
||||
options,
|
||||
|_cc| Box::new(MyApp::default()),
|
||||
Box::new(|_cc| Box::new(MyApp::default())),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ fn main() {
|
||||
eframe::run_native(
|
||||
"Native file dialogs and drag-and-drop files",
|
||||
options,
|
||||
|_cc| Box::new(MyApp::default()),
|
||||
Box::new(|_cc| Box::new(MyApp::default())),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,11 @@ use eframe::egui;
|
||||
|
||||
fn main() {
|
||||
let options = eframe::NativeOptions::default();
|
||||
eframe::run_native("My egui App", options, |_cc| Box::new(MyApp::default()));
|
||||
eframe::run_native(
|
||||
"My egui App",
|
||||
options,
|
||||
Box::new(|_cc| Box::new(MyApp::default())),
|
||||
);
|
||||
}
|
||||
|
||||
struct MyApp {
|
||||
|
||||
@@ -5,9 +5,11 @@ use egui_extras::RetainedImage;
|
||||
|
||||
fn main() {
|
||||
let options = eframe::NativeOptions::default();
|
||||
eframe::run_native("Show an image with eframe/egui", options, |_cc| {
|
||||
Box::new(MyApp::default())
|
||||
});
|
||||
eframe::run_native(
|
||||
"Show an image with eframe/egui",
|
||||
options,
|
||||
Box::new(|_cc| Box::new(MyApp::default())),
|
||||
);
|
||||
}
|
||||
|
||||
struct MyApp {
|
||||
|
||||
@@ -11,7 +11,11 @@ fn main() {
|
||||
initial_window_size: Some(egui::vec2(1000.0, 700.0)),
|
||||
..Default::default()
|
||||
};
|
||||
eframe::run_native("svg example", options, |_cc| Box::new(MyApp::default()));
|
||||
eframe::run_native(
|
||||
"svg example",
|
||||
options,
|
||||
Box::new(|_cc| Box::new(MyApp::default())),
|
||||
);
|
||||
}
|
||||
|
||||
struct MyApp {
|
||||
|
||||
Reference in New Issue
Block a user