pub trait DeclarativeUi {
// Required method
fn render<'a>(&mut self, node: &mut Node<'a>) -> GuiResult<WidgetId>;
}Expand description
Extension trait to add declarative rendering to the Ui engine.
§GTK container layout contract
GTK flow containers (Container, GroupBox) lay their flow children out
natively using an internal gtk::Box container rather than placing each
child at layout-computed absolute coordinates. Because of this:
- Spacing between flow children is governed by the box spacing
(
Ui::set_container_gap). - Container insets are governed by the container’s CSS padding
(
Ui::set_container_padding).
During DeclarativeUi::render, Node::padding and Node::gap
are forwarded directly to these backend container properties, ensuring that
the native GTK box and the shared layout agree on child spacing and
margins across all supported backends (Mock, GTK4, Win32).
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".