pub trait App: Send + 'static {
// Required method
fn ui(&mut self, ui: &mut Ui, frame: &mut Frame);
// Provided methods
fn build(
&mut self,
egui_ctx: Context,
frame: &mut Frame,
) -> Result<(), HandlerError> { ... }
fn resized(&mut self, size: WindowSize) { ... }
fn zoom_factor_changed(&mut self, zoom_factor: f32) { ... }
}Expand description
Implement this trait to run an app with egui-baseview.
Required Methods§
Provided Methods§
Sourcefn build(
&mut self,
egui_ctx: Context,
frame: &mut Frame,
) -> Result<(), HandlerError>
fn build( &mut self, egui_ctx: Context, frame: &mut Frame, ) -> Result<(), HandlerError>
Called once before the first frame. Setup code such as egui_ctx.set_fonts()
can be done here.
If an error is returned, then the window will be closed.
Sourcefn resized(&mut self, size: WindowSize)
fn resized(&mut self, size: WindowSize)
Called when the window has been resized.
The given size takes the zoom factor into account.
Sourcefn zoom_factor_changed(&mut self, zoom_factor: f32)
fn zoom_factor_changed(&mut self, zoom_factor: f32)
Called when the zoom factor has changed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".