Skip to main content

Widget

Trait Widget 

Source
pub trait Widget {
Show 14 methods // Provided methods fn event(&mut self, _ctx: &mut EventCtx, _event: &Event) { ... } fn debug_name(&self) -> &'static str { ... } fn measure( &mut self, _ctx: &mut MeasureCtx, constraints: Constraints, ) -> Size { ... } fn arrange(&mut self, _ctx: &mut ArrangeCtx, _bounds: Rect) { ... } fn paint(&self, _ctx: &mut PaintCtx) { ... } fn layer_options(&self) -> LayerOptions { ... } fn layer_properties(&self) -> LayerProperties { ... } fn stack_host_options(&self) -> Option<StackHostOptions> { ... } fn stack_surface_options(&self) -> Option<StackSurfaceOptions> { ... } fn semantics(&self, _ctx: &mut SemanticsCtx) { ... } fn accepts_focus(&self) -> bool { ... } fn focus_changed(&mut self, _ctx: &mut EventCtx, _focused: bool) { ... } fn visit_children(&self, _visitor: &mut dyn WidgetPodVisitor) { ... } fn visit_children_mut(&mut self, _visitor: &mut dyn WidgetPodMutVisitor) { ... }
}

Provided Methods§

Source

fn event(&mut self, _ctx: &mut EventCtx, _event: &Event)

Source

fn debug_name(&self) -> &'static str

Source

fn measure(&mut self, _ctx: &mut MeasureCtx, constraints: Constraints) -> Size

Source

fn arrange(&mut self, _ctx: &mut ArrangeCtx, _bounds: Rect)

Source

fn paint(&self, _ctx: &mut PaintCtx)

Source

fn layer_options(&self) -> LayerOptions

Source

fn layer_properties(&self) -> LayerProperties

Source

fn stack_host_options(&self) -> Option<StackHostOptions>

Source

fn stack_surface_options(&self) -> Option<StackSurfaceOptions>

Source

fn semantics(&self, _ctx: &mut SemanticsCtx)

Source

fn accepts_focus(&self) -> bool

Source

fn focus_changed(&mut self, _ctx: &mut EventCtx, _focused: bool)

Source

fn visit_children(&self, _visitor: &mut dyn WidgetPodVisitor)

Visit this widget’s logical children.

The children do not need to correspond to every piece of state or every visual element a widget owns internally. A widget may expose retained local children, generated/virtual children, remote children represented by local pods, or only the subset that should cooperate with the SUI runtime for this pass.

Source

fn visit_children_mut(&mut self, _visitor: &mut dyn WidgetPodMutVisitor)

Mutably visit this widget’s logical children.

This is the mutable counterpart to Widget::visit_children; SUI uses it as a cooperation point for the retained runtime, not as ownership of a widget’s complete internal model.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§