Trait Widget

Source
pub trait Widget: DataProcessor {
    // Required method
    fn to_native(
        &mut self,
        _widget_generator: &mut dyn WidgetGenerator,
    ) -> Result<NativeWidget, ()>;

    // Provided method
    fn draw(&mut self) { ... }
}
Expand description

Minimal UI element.

Widget represents minimal UI element. Most common widgets is Button and TextEdit.

Required Methods§

Source

fn to_native( &mut self, _widget_generator: &mut dyn WidgetGenerator, ) -> Result<NativeWidget, ()>

Generate native widget

Provided Methods§

Source

fn draw(&mut self)

Allows drawing on top of generated NativeWidget

Implementors§