Every widget is defined by a layout, which is a Lua table with the following fields (all of them are optional):
1.`type`: One of the available widget types from `openmw.ui.TYPE`.
2. | `props`: A Lua table, containing all the properties values.
| Properties define most of the information about the widget: its position, data it displays, etc.
| See the widget pages (table below) for details on specific properties.
| Properties of the basic Widget are inherited by all the other widgets.
3. | `events`: A Lua table, containing `openmw.async.callback` values, which trigger on various interactions with the widget.
| See the Widget pages for details on specific events.
| Events of the basic Widget are inherited by all the other widgets.
4.`content`: a Content (`openmw.ui.content`), which contains layouts for the children of this widget.
5. | `name`: an arbitrary string, the only limitatiion is it being unique within a `Content`.
| Helpful for navigatilng through the layouts.
6.`layer`: only applies for the root widget. (Windows, HUD, etc)
.. TODO: Write a more detailed documentation for layers when they are finished
Elements
--------
Element is the root widget of a layout.
It is an independent part of the UI, connected only to a specific layer, but not any other layouts.
Creating or destroying an element also creates/destroys all of its children.
Content
-------
A container holding all the widget's children. It has a few important differences from a Lua table:
1. All the keys are integers, i. e. it is an "array"
2. Holes are not allowed. At any point all keys from `1` to the highest `n` must contain a value.
3. | You can access the values by their `name` field as a `Content` key.
| While there is nothing preventing you from changing the `name` of a table inside a content, it is not supported, and will lead to undefined behaviour.
| If you have to change the name, assign a new table to the index instead.
.. TODO: Talk about skins/templates here when they are ready