[][src]Macro gtk_fnonce_on_eventloop::widget_refs

macro_rules! widget_refs {
    ( $structname:ident ; $( $i:ident : $t:ty),* ) => { ... };
    ( ;GET_REFS; $structname:ident ; $( $i:ident : $t:ty ),* ) => { ... };
    ( ;REF_STRUCT; $structname:ident ; $( $i:ident : $t:ty ),* ) => { ... };
    ( ;IMPL_GETTERS; $structname:ident ; $( $i:ident : $t:ty ),* ) => { ... };
}

Create a struct Structname with the given fields. Also implement From<gtk::Builder> for this struct and a function for each field that returns a .clone()ed widget.

Example usage

widget_refs!(WigdetRefs;
    main_window : gtk::Window,
    ...
);

Generated items

    pub struct WidgetRefs {
        pub main_window : gtk::Window,
        ...
    }
    impl From<&gtk::Builder> for WidgetRefs { ... };
    impl WidgetRefs {
        fn main_window() -> gtk::Window { }
        ...
    }