widget_set_rect!() { /* proc-macro */ }
Expand description
Macro to set the rect
stored in the widget core
Widgets have a hidden field of type Rect
in their widget_core!()
, used
to implement method Layout::rect
. This macro assigns to that field.
This macro is usable only within the definition of Layout::set_rect
within
an impl_self
, impl_scope!
or impl_anon!
macro using the
widget
attribute.
The method Layout::rect
will be generated if this macro is used by the
widget, otherwise a definition of the method must be provided.
Example usage:
ⓘ
fn set_rect(&mut self, _: &mut ConfigCx, rect: Rect, _: AlignHints) {
widget_set_rect!(rect);
}