Declare a widget: find or create its node, make it the next child of the open container and return it. This is what the library's own widgets use; a custom widget calls it too.
- kind: whether the node is text, a leaf with a paint callback, or a container.
- role: what the widget is.
- style: layout and paint options.
- loc: the call site. It identifies the node from one frame to the next, so pass the caller's location.
widget :: (
kind: Node_Kind,
role: Role,
style: Style,
loc: Source_Code_Location
) -> *Node
Declare a widget: find or create its node, make it the next child of the open container and return it. This is what the library's own widgets use; a custom widget calls it too.
Parameters
- kind: Node_Kind
- whether the node is text, a leaf with a paint callback, or a container.
- role: Role
- what the widget is.
- style: Style
- layout and paint options.
- loc: Source_Code_Location
- the call site. It identifies the node from one frame to the next, so pass the caller's location.
Returns
- *Node