1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

trait App now has fn name() for specifying egui_glium window title

This commit is contained in:
Emil Ernerfeldt
2020-12-18 22:30:59 +01:00
parent 71449fe61c
commit b0e17638df
9 changed files with 22 additions and 8 deletions

View File

@@ -15,6 +15,10 @@ impl Default for ExampleApp {
}
impl egui::app::App for ExampleApp {
fn name(&self) -> &str {
"Egui Example"
}
/// Called each time the UI needs repainting, which may be many times per second.
/// Put your widgets into a `SidePanel`, `TopPanel`, `CentralPanel`, `Window` or `Area`.
fn ui(

View File

@@ -7,8 +7,6 @@ mod example_app;
use example_app::ExampleApp;
fn main() {
let title = "My Egui Window";
// Persist app state to file:
let storage = egui_glium::storage::FileStorage::from_path(".egui_example_glium.json");
@@ -18,5 +16,5 @@ fn main() {
// Restore `example_app` from file, or create new `ExampleApp`:
let app: ExampleApp = egui::app::get_value(&storage, egui::app::APP_KEY).unwrap_or_default();
egui_glium::run(title, Box::new(storage), Box::new(app));
egui_glium::run(Box::new(storage), Box::new(app));
}