Skip to content

Commit

Permalink
Clarify child element update behavior in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
uramer committed Nov 24, 2023
1 parent 9403f06 commit 2be3824
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion files/lua_api/openmw/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,35 @@
-- @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
-- @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
-- @function [parent=#Element] destroy
Expand Down

0 comments on commit 2be3824

Please sign in to comment.