Skip to main content

Widget

Trait Widget 

Source
pub trait Widget {
    // Provided methods
    fn render_widget_bounds(&self, _bounds: Rect, _style: &Style) { ... }
    fn handle_widget_event(
        &mut self,
        _event: &UiEvent,
        _ctx: &mut EventContext,
    ) -> EventPolicy { ... }
    fn get_property(&self, _key: PropertyKey) -> Option<PropertyValue<'_>> { ... }
    fn set_property<'a>(
        &mut self,
        _key: PropertyKey,
        _val: PropertyValue<'a>,
    ) -> Result<(), PropertyError> { ... }
}

Provided Methods§

Source

fn render_widget_bounds(&self, _bounds: Rect, _style: &Style)

Source

fn handle_widget_event( &mut self, _event: &UiEvent, _ctx: &mut EventContext, ) -> EventPolicy

Source

fn get_property(&self, _key: PropertyKey) -> Option<PropertyValue<'_>>

Source

fn set_property<'a>( &mut self, _key: PropertyKey, _val: PropertyValue<'a>, ) -> Result<(), PropertyError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§