Skip to main content

widget_core

Macro widget_core 

Source
macro_rules! widget_core {
    () => { ... };
}
Expand description

Type of the widget’s core

This is a special placeholder macro for usage only with the widget macro. It expands to a type, dependant on the current widget.

This type always implements the WidgetCore trait.

This type may implement the WidgetCoreRect trait.

§Example

use kas::{impl_self, Events};

#[impl_self]
mod MyHelloWidget {
    /// A simple greeting
    #[widget]
    #[layout("Hello!")]
    struct MyHelloWidget(widget_core!());

    impl Events for Self {
        type Data = ();
    }
}