pub trait Surface: Send + Sync {
// Required method
fn paint(&self, gfx: &GfxContext, rect: Rect);
// Provided methods
fn pointer(&self, ev: Pointer, size: (f32, f32)) -> bool { ... }
fn scroll(&self, dy: f32, size: (f32, f32)) -> bool { ... }
}Expand description
What a surface widget draws and how it takes the pointer — see the module docs.
Required Methods§
Sourcefn paint(&self, gfx: &GfxContext, rect: Rect)
fn paint(&self, gfx: &GfxContext, rect: Rect)
Draws into rect (screen GUI pixels, the widget’s box less its
padding). Called every frame the widget is visible.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".