[][src]Trait tuikit::widget::Widget

pub trait Widget<Message = ()>: Draw {
    fn size_hint(&self) -> (Option<usize>, Option<usize>) { ... }
fn on_event(&self, event: Event, rect: Rectangle) -> Vec<Message> { ... } }

A widget could be recursive nested

Provided methods

fn size_hint(&self) -> (Option<usize>, Option<usize>)

the (width, height) of the content it will be the hint for layouts to calculate the final size

fn on_event(&self, event: Event, rect: Rectangle) -> Vec<Message>

given a key event, emit zero or more messages typical usage is the mouse click event where containers would pass the event down to their children.

Loading content...

Implementations on Foreign Types

impl<Message, T: Widget<Message>, '_> Widget<Message> for &'_ T[src]

impl<Message, T: Widget<Message> + ?Sized> Widget<Message> for Box<T>[src]

Loading content...

Implementors

impl<'a, Message> Widget<Message> for HSplit<'a, Message>[src]

impl<'a, Message> Widget<Message> for Stack<'a, Message>[src]

impl<'a, Message> Widget<Message> for VSplit<'a, Message>[src]

impl<'a, Message> Widget<Message> for Win<'a, Message>[src]

Loading content...