mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 12:41:37 +00:00
Clarify child element update behavior in the documentation
This commit is contained in:
parent
9403f06618
commit
2be3824d9e
1 changed files with 26 additions and 1 deletions
|
@ -228,10 +228,35 @@
|
||||||
-- @type Element
|
-- @type Element
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Refreshes the rendered element to match the current layout state
|
-- Refreshes the rendered element to match the current layout state.
|
||||||
|
-- Refreshes positions and sizes, but not the layout of the child Elements.
|
||||||
-- @function [parent=#Element] update
|
-- @function [parent=#Element] update
|
||||||
-- @param self
|
-- @param self
|
||||||
|
|
||||||
|
-- @usage
|
||||||
|
-- local child = ui.create {
|
||||||
|
-- type = ui.TYPE.Text,
|
||||||
|
-- props = {
|
||||||
|
-- text = 'child 1',
|
||||||
|
-- },
|
||||||
|
-- }
|
||||||
|
-- local parent = ui.create {
|
||||||
|
-- content = ui.content {
|
||||||
|
-- child,
|
||||||
|
-- {
|
||||||
|
-- type = ui.TYPE.Text,
|
||||||
|
-- props = {
|
||||||
|
-- text = 'parent 1',
|
||||||
|
-- },
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- -- ...
|
||||||
|
-- child.layout.props.text = 'child 2'
|
||||||
|
-- parent.layout.content[2].props.text = 'parent 2'
|
||||||
|
-- parent:update() -- will show 'parent 2', but 'child 1'
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Destroys the element
|
-- Destroys the element
|
||||||
-- @function [parent=#Element] destroy
|
-- @function [parent=#Element] destroy
|
||||||
|
|
Loading…
Reference in a new issue