[][src]Trait kas::Widget

pub trait Widget: SendEvent { }

Widget trait

Widgets must implement a family of traits, of which this trait is the final member:

  • WidgetCore — base functionality (this trait is always derived)
  • WidgetChildren — enumerates children and provides methods derived from this
  • Layout — handles sizing and positioning of self and children
  • WidgetConfig — the last unparametrised trait allows customisation of some aspects of widget behaviour
  • event::Handler — parametrised widgets over a Msg type and handles events
  • event::SendEvent — routes events to children and handles responses
  • Widget — the final trait

Widgets must use the derive(Widget) macro to implement at least WidgetCore and Widget; these two traits must not be implemented manually or users may face unexpected breaking changes. This macro can optionally implement all above traits, and by default will implement all except for Layout. This opt-out derive behaviour means that adding additional traits into the family is not a breaking change.

To refer to a widget via dyn trait, use &dyn WidgetConfig (or, if the message type is known, one may use &dyn Widget<Msg = M>). To refer to a widget in generic functions, use <W: Widget> or <M, W: Widget<Msg = M>>.

Trait Implementations

impl<W: Widget + Sized> Boxed<dyn Widget<Msg = <W as Handler>::Msg> + 'static> for W[src]

Implementations on Foreign Types

impl<M: 'static> Widget for Box<dyn Widget<Msg = M>>[src]

impl<M: 'static> Widget for Box<dyn Menu<Msg = M>>[src]

Loading content...

Implementors

impl Widget for AccelLabel[src]

impl Widget for DragHandle[src]

impl Widget for Filler[src]

impl Widget for Label[src]

impl Widget for MessageBox[src]

impl<D: Directional> Widget for ScrollBar<D>[src]

impl<D: Directional, W: Widget> Widget for List<D, W>[src]

impl<D: Directional, W: Widget> Widget for Splitter<D, W>[src]

impl<D: Directional, W: Menu> Widget for MenuBar<D, W>[src]

impl<D: Directional, W: Menu> Widget for SubMenu<D, W>[src]

impl<G: 'static> Widget for EditBox<G> where
    G: EditGuard
[src]

impl<M: 'static> Widget for CheckBox<M> where
    M: From<VoidMsg>, 
[src]

impl<M: 'static> Widget for CheckBoxBare<M>[src]

impl<M: 'static> Widget for MenuToggle<M> where
    M: From<VoidMsg>, 
[src]

impl<M: 'static> Widget for RadioBox<M> where
    M: From<VoidMsg>, 
[src]

impl<M: 'static> Widget for RadioBoxBare<M>[src]

impl<M: Clone + Debug + 'static> Widget for ComboBox<M>[src]

impl<M: Clone + Debug + 'static> Widget for MenuEntry<M>[src]

impl<M: Clone + Debug + 'static> Widget for TextButton<M>[src]

impl<M: Debug + 'static> Widget for Separator<M>[src]

impl<T: SliderType, D: Directional> Widget for Slider<T, D>[src]

impl<W: Widget + 'static> Widget for Window<W> where
    W: Widget<Msg = VoidMsg>, 
[src]

impl<W: Widget> Widget for Frame<W>[src]

impl<W: Widget> Widget for MenuFrame<W>[src]

impl<W: Widget> Widget for ScrollRegion<W>[src]

impl<W: Widget> Widget for Stack<W>[src]

Loading content...