Trait epi::App[][src]

pub trait App {
    fn update(&mut self, ctx: &CtxRef, frame: &mut Frame<'_>);
fn name(&self) -> &str; fn setup(&mut self, _ctx: &CtxRef) { ... }
fn warm_up_enabled(&self) -> bool { ... }
fn load(&mut self, _storage: &dyn Storage) { ... }
fn save(&mut self, _storage: &mut dyn Storage) { ... }
fn on_exit(&mut self) { ... }
fn auto_save_interval(&self) -> Duration { ... }
fn is_resizable(&self) -> bool { ... }
fn clear_color(&self) -> Rgba { ... } }

Implement this trait to write apps that can be compiled both natively using the egui_glium crate, and deployed as a web site using the egui_web crate.

Required methods

fn update(&mut self, ctx: &CtxRef, frame: &mut Frame<'_>)[src]

Called each time the UI needs repainting, which may be many times per second. Put your widgets into a egui::SidePanel, egui::TopPanel, egui::CentralPanel, egui::Window or egui::Area.

fn name(&self) -> &str[src]

The name of your App.

Loading content...

Provided methods

fn setup(&mut self, _ctx: &CtxRef)[src]

Called once before the first frame. Allows you to do setup code and to call ctx.set_fonts(). Optional.

fn warm_up_enabled(&self) -> bool[src]

If true a warm-up call to Self::update will be issued where ctx.memory().everything_is_visible() will be set to true.

In this warm-up call, all painted shapes will be ignored.

fn load(&mut self, _storage: &dyn Storage)[src]

Called once on start. Allows you to restore state.

fn save(&mut self, _storage: &mut dyn Storage)[src]

Called on shutdown, and perhaps at regular intervals. Allows you to save state.

fn on_exit(&mut self)[src]

Called once on shutdown (before or after save())

fn auto_save_interval(&self) -> Duration[src]

Time between automatic calls to save()

fn is_resizable(&self) -> bool[src]

Returns true if this app window should be resizable.

fn clear_color(&self) -> Rgba[src]

Background color for the app, e.g. what is sent to gl.clearColor. This is the background of your windows if you don't set a central panel.

Loading content...

Implementors

Loading content...