Extend get_widget! macro to return widget optionally

parent a941cd01
Pipeline #155844 passed with stages
in 5 minutes and 17 seconds
#[macro_export]
macro_rules! get_widget {
($builder:expr, $wtype:ty, @$name:ident) => {{
let $name: $wtype = $builder.get_object(stringify!($name)).expect(&format!("Could not find widget \"{}\"", stringify!($name)));
$name
}};
($builder:expr, $wtype:ty, $name:ident) => {
let $name: $wtype = $builder.get_object(stringify!($name)).expect(&format!("Could not find widget \"{}\"", stringify!($name)));
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment