Trait Widget

Source
pub trait Widget {
    // Required method
    fn calc_constraints(
        &mut self,
        children: &ConstraintsContext<'_>,
    ) -> Constraints;

    // Provided methods
    fn sense(&mut self) -> Option<&mut Sense> { ... }
    fn update(&mut self, delta_time: f64) { ... }
    fn draw(&mut self, cx: &mut DrawContext<'_, '_>) { ... }
    fn handle_event(&mut self, event: &Event) { ... }
    fn walk_children_mut(&mut self, f: &mut dyn FnMut(&mut dyn Widget)) { ... }
    fn layout_children(&mut self, cx: &mut LayoutContext<'_>) { ... }
}

Required Methods§

Source

fn calc_constraints(&mut self, children: &ConstraintsContext<'_>) -> Constraints

Provided Methods§

Source

fn sense(&mut self) -> Option<&mut Sense>

Source

fn update(&mut self, delta_time: f64)

Source

fn draw(&mut self, cx: &mut DrawContext<'_, '_>)

Source

fn handle_event(&mut self, event: &Event)

Source

fn walk_children_mut(&mut self, f: &mut dyn FnMut(&mut dyn Widget))

Source

fn layout_children(&mut self, cx: &mut LayoutContext<'_>)

Trait Implementations§

Source§

impl Widget for Box<dyn Widget + '_>

Source§

fn calc_constraints(&mut self, cx: &ConstraintsContext<'_>) -> Constraints

Source§

fn walk_children_mut(&mut self, f: &mut dyn FnMut(&mut dyn Widget))

Source§

fn sense(&mut self) -> Option<&mut Sense>

Source§

fn update(&mut self, delta_time: f64)

Source§

fn draw(&mut self, cx: &mut DrawContext<'_, '_>)

Source§

fn handle_event(&mut self, event: &Event)

Source§

fn layout_children(&mut self, cx: &mut LayoutContext<'_>)

Implementations on Foreign Types§

Source§

impl Widget for &str

Source§

fn calc_constraints(&mut self, cx: &ConstraintsContext<'_>) -> Constraints

Source§

fn draw(&mut self, cx: &mut DrawContext<'_, '_>)

Source§

impl Widget for Box<dyn Widget + '_>

Source§

fn calc_constraints(&mut self, cx: &ConstraintsContext<'_>) -> Constraints

Source§

fn walk_children_mut(&mut self, f: &mut dyn FnMut(&mut dyn Widget))

Source§

impl Widget for String

Source§

fn calc_constraints(&mut self, cx: &ConstraintsContext<'_>) -> Constraints

Source§

fn draw(&mut self, cx: &mut DrawContext<'_, '_>)

Source§

impl<T: Widget> Widget for Box<T>

Source§

fn calc_constraints(&mut self, children: &ConstraintsContext<'_>) -> Constraints

Source§

fn walk_children_mut(&mut self, f: &mut dyn FnMut(&mut dyn Widget))

Implementors§

Source§

impl Widget for Button<'_>

Source§

impl Widget for ColorBox

Source§

impl Widget for Void

Source§

impl<'a> Widget for Column<'a>

Source§

impl<'a> Widget for Row<'a>

Source§

impl<'a> Widget for Slider<'a>

Source§

impl<'a> Widget for Stack<'a>

Source§

impl<T: AsRef<str>, F: AsRef<Font>> Widget for Text<T, F>

Source§

impl<T: Widget> Widget for Align<T>

Source§

impl<T: Widget> Widget for ConstraintOverride<T>

Source§

impl<T: Widget> Widget for Padding<T>

Source§

impl<T: Widget> Widget for Shrink<T>