Skip to main content

Module widget

Module widget 

Source
Expand description

The widget model: the Widget trait, view nodes, layout properties and the contexts widgets measure, paint and handle events with.

An application’s view builds a fresh tree of Nodes every frame through View. The runtime assigns every node a WidgetId, lays the tree out while painting it, and keeps the tree until the next frame so input can reach the widgets that were on screen.

Structs§

EventCx
Event handling context.
LayoutProps
Layout properties of a node.
MeasureCx
Measuring context.
Node
One widget in the view tree with its layout properties.
NodeMut
Adjusts the node just added. Every method changes the node in place, so the result can be ignored or chained.
PaintCx
Painting context: draws into the frame, clipped to the widget’s visible area.
View
Collects the nodes of one container while an application’s view runs.
WidgetId
Identifies a widget across frames.

Enums§

Align
Where children sit along an axis when there is room left.
Length
How much space a node takes along one axis.

Traits§

Container
A widget whose children are built with a closure, see View::add_with.
Widget
Something that can be laid out, painted and interacted with.