Macro gstore::stack[][src]

macro_rules! stack {
    (
        $(class $class:literal)?

        $(properties $($stateful:ident)? {
            $( $prop:ident: $value:expr )*
        })?

        $(connections {
            $(
                $( ($store:ident) => )? $connector:ident: $connection:expr
            )*
        })?

        $(children [
            $($child:expr)*
        ])?

        $(children_properties [
            $( ($child_name:expr, $child_title:expr, $child_icon:expr) )*
        ])?
    ) => { ... };
    (
        $($child:expr)*
    ) => { ... };
}

Creates a GTK stack.

See Also

Examples

stack! {
    class "css-class"
    properties {
        visible_child_name: "test"
    }
    connections {
        connect_property_visible_child_notify: move |s| {
            println!("Changed child: {:?}", s.get_visible_child_name().unwrap())
        }
    }
    children [
        label!(just "Test Label")
    ]
    children_properties [
        // (Option<GTK widget name>, Option<Stack item title>, Option<icon name>)
        (Some("child1"), Some("Child One".to_string()), Some("web-browser-symbolic"))
    ]
};