RenderNode Struct

Platform Contract

#include <vortex/vrender.h>

Public Members

VNodeType type { VNodeType::Box }
std::string name
std::string path
std::string text
ResolvedStyle style
std::vector<RenderNode> children
std::vector<ComboOption> comboOptions
std::string comboSelected

Detailed Description

A node describes a particular UI element: a hierarchical component (nodes can compose other nodes) based on a primitive type that can be rendered by a consumer reconciler.

The render tree is composed with Layers .lyr files that Vortex refers to as styles since they describe UI elements. VPlatform::build_render_tree() produces the nodes from the loaded styles, and each node in the tree carries its resolved style data.

How styles translate to nodes

The following demonstrates how a node is structured from a style:

Launch Card:                        // type = `VNodeType::Box`
    // Attribute declarations       // name = "Launch Card"
                                    // path = "Launch Card"
    Label << Vortex/Text:           // text = ""
        Text: "Launch the service"  // style = { ... }
                                    // children = {
                                    //     { type = `VNodeType::Text`
                                    //       name = "Label"
                                    //       path = "Launch Card/Label"
                                    //       text = "Launch the service"
                                    //       style = { ... }
                                    //       children = {}
                                    //     }
                                    // }

Member Variable Documentation

VNodeType type { VNodeType::Box }

Type of node; VNodeType::Box by default

std::string name

The node's style name; the last path segment

std::string path

Full /-separated style path (e.g. "Main Window/Greeting")

std::string text

Text content from either the style's declared Text attribute, or the bind_text() value when bound.

ResolvedStyle style

Style resolved from .lyr

std::vector<RenderNode> children

Child nodes

std::vector<ComboOption> comboOptions

ComboBox only: List of available options

std::string comboSelected

ComboBox only: Selected option's ID

› Documentation
Appearance
Theme
—