pub trait Widget {
// Provided methods
fn style(&self) -> Style { ... }
fn draw(&self, _ctx: &mut DrawContext<'_>) { ... }
fn handle_event(&mut self, _ctx: &mut EventContext<'_>) -> bool { ... }
fn handle_key_event(
&mut self,
_event: &KeyEvent,
_modifiers: ModifiersState,
) -> bool { ... }
fn is_focusable(&self) -> bool { ... }
fn set_focus(&mut self, _focused: bool) { ... }
fn activate(&mut self) { ... }
fn clear_active(&mut self) { ... }
fn is_scrollable(&self) -> bool { ... }
fn update_measures(&mut self, _measures: &[Vec<f32>]) { ... }
}Provided Methods§
fn style(&self) -> Style
fn draw(&self, _ctx: &mut DrawContext<'_>)
fn handle_event(&mut self, _ctx: &mut EventContext<'_>) -> bool
Sourcefn handle_key_event(
&mut self,
_event: &KeyEvent,
_modifiers: ModifiersState,
) -> bool
fn handle_key_event( &mut self, _event: &KeyEvent, _modifiers: ModifiersState, ) -> bool
Called when this widget has focus and a key is pressed. Returns true if the event was consumed.
fn is_focusable(&self) -> bool
fn set_focus(&mut self, _focused: bool)
fn activate(&mut self)
fn clear_active(&mut self)
fn is_scrollable(&self) -> bool
Sourcefn update_measures(&mut self, _measures: &[Vec<f32>])
fn update_measures(&mut self, _measures: &[Vec<f32>])
Called after text rendering to feed back measured pixel widths.