Macro gstore::widget[][src]

macro_rules! widget {
    (
        $widget:ident {
            $(class $class:literal)?
            $(properties $($stateful:ident)? {
                $( $prop:ident: $value:expr )*
            })?
            $(connections {
                $(
                    $( ($store:ident) )? $connector:ident: $connection:expr
                )*
            })?
            $(children [
                $($child:expr)*
            ])?
        }
    ) => { ... };
}

Abstract GTK widget basis macro.

All widget macros utilize this macro to generate required code. The widget macro defines how widgets are defined:

widget! {
    class <a css class string literal>
    properties <optional the 'keyword' stateful to listen to a locally defined state (see use_state)> {
        <gtk widget property>: <property value expression>
        ...
    }
    connections {
        <(store) if the store may be used in the following closure> <connector name>: <closure to call for the signal of the connector>
        ...
    }
    children [
        <any child expression like another widget macro or a component function>
    ]
}