Skip to main content

Widget

Trait Widget 

Source
pub trait Widget: Discoverable {
    // Required methods
    fn draw(&self, painter: &mut dyn Painter, area: Rect);
    fn ui_node(&self) -> UiNode;
}
Expand description

Trait implemented by all widgets.

Required Methods§

Source

fn draw(&self, painter: &mut dyn Painter, area: Rect)

Render the widget into the given area using the painter.

Source

fn ui_node(&self) -> UiNode

Build a UI node for ontology registration.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§