1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -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

@@ -12,6 +12,10 @@ use crate::Context;
/// Implement this trait to write apps that can be compiled both natively using the [`egui_glium`](https://crates.io/crates/egui_glium) crate,
/// and deployed as a web site using the [`egui_web`](https://crates.io/crates/egui_web) crate.
pub trait App {
/// The name of your App.
fn name(&self) -> &str;
}
/// Called once before the first frame.
/// Allows you to do setup code and to call `ctx.set_fonts()`.
/// Optional.

View File

@@ -278,6 +278,10 @@ impl DemoApp {
}
impl app::App for DemoApp {
fn name(&self) -> &str {
"Egui Demo"
}
fn ui(
&mut self,
ctx: &Arc<Context>,