import{_ as t,a,b as r,ag as n}from"./chunks/framework.BcrMLAmg.js";const m=JSON.parse('{"title":"Container","description":"","frontmatter":{},"headers":[],"relativePath":"references/elements/Container.md","filePath":"references/elements/Container.md","lastUpdated":1757844696000}'),i={name:"references/elements/Container.md"};function d(o,e,l,h,c,s){return r(),a("div",null,e[0]||(e[0]=[n('
The Container class serves as a fundamental building block for organizing UI elements. It acts as a parent element that can hold and manage child elements.
Extends: VisualElement
| Property | Type | Default | Description |
|---|---|---|---|
| children | table | {} | The children of the container |
| childrenSorted | boolean | true | Whether the children are sorted |
| childrenEventsSorted | boolean | true | Whether the children events are sorted |
| childrenEvents | table | {} | The children events of the container |
| eventListenerCount | table | {} | The event listener count of the container |
| focusedChild | table | nil | The focused child of the container |
| visibleChildren | table | {} | The visible children of the container |
| visibleChildrenEvents | table | {} | The visible children events of the container |
| offsetX | number | 0 | Horizontal content offset |
| offsetY | number | 0 | Vertical content offset |
| Method | Returns | Description |
|---|---|---|
| Container:isChildVisible | boolean | Returns whether a child is visible |
| Container:addChild | Container | Adds a child to the container |
| Container:clear | Container | Clears the container |
| Container:sortChildren | Container | Sorts the children of the container |
| Container:sortChildrenEvents | Container | Sorts the children events of the container |
| Container:registerChildrenEvents | Container | Registers the children events of the container |
| Container:registerChildEvent | Container | Registers the children events of the container |
| Container:removeChildrenEvents | Container | Unregisters the children events of the container |
| Container:unregisterChildEvent | Container | Unregisters the children events of the container |
| Container:removeChild | Container | Removes a child from the container |
| Container:getChild | self | Removes a child from the container |
| Container:callChildrenEvent | boolean, child | Calls a event on all children |
Returns whether a child is visible
child table The child to checkboolean boolean the child is visibleAdds a child to the container
child table The child to addContainer self The container instanceClears the container
Container self The container instanceSorts the children of the container
Container self The container instanceSorts the children events of the container
eventName string The event name to sortContainer self The container instanceRegisters the children events of the container
child table The child to register events forContainer self The container instanceRegisters the children events of the container
child table The child to register events foreventName string The event name to registerContainer self The container instanceUnregisters the children events of the container
child table The child to unregister events forContainer self The container instanceUnregisters the children events of the container
child table The child to unregister events foreventName string The event name to unregisterContainer self The container instanceRemoves a child from the container
child table The child to removeContainer self The container instanceRemoves a child from the container
path string The path to the child to removeself The container instanceCalls a event on all children
visibleOnly boolean Whether to only call the event on visible childrenevent string The event to callboolean handled Whether the event was handledchild The child that handled the event