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:
@@ -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(
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user