V UI applicationV UI is based on gg which itself relies on sokol.
Window instanceThe first declaration needed to build a V UI example is a Window instance that is in charge to launch a graphical window in your OS.
To have the full list of arguments of its constructor ui.window(), have a look at here.
The main arguments are:
title: the title of the windowwidth and height: size of the windowlayout: root layout (should be: ui.BoxLayout, ui.Stack and ui.CanvasLayout)children (if layout not provided): an array of graphical elements (Widgets/Layouts/Components)mode: initial state of the windowbg_color: background color of the windowA widget is a graphical element that is correspond to a struct which is compliant to the Widget interface:
In particular, a Layout (see next tab) is a (sub)interface of Widget to arrange many Widgets.
The graphical elements of a V UI application is then represented by a sort of children tree.
A Layout is an interface to represent struct elements that allow us to arrange widgets together depending on the kind of the layout:
A component is a concept introduced to define composite element build from widgets, layouts or components. Technically speaking, a Component is based on:
struct gathering all the contents needed to make the component workingHowever, a developer that wants to create a new Component has no need to know that internal representation of a component child.
This is the template to fulfill in order to create a new component called Example (name that has to be changed):