update doc/*/scripting/builtins/libgui.md

This commit is contained in:
MihailRis 2026-05-21 21:43:14 +03:00
parent 411021052e
commit d3760d5b7c
2 changed files with 20 additions and 8 deletions

View file

@ -149,16 +149,22 @@ gui.load_document(
args: table
) -> str
-- Loads a template into the layout
-- Loads and processes layout template from file
gui.template(
-- template name in /layouts/templates without path and extension
name: str,
-- variable table (can be used in markup)
-- * Ex: <label>%{text}</label>
-- * text in this case is the value from params with the text key
params: table,
-- table, available in events as the global variable DATA
[optional] data: table
params: table
) -> str
-- Processes layout template from string
gui.process_template(
-- template source code
source: str,
-- variable table (same as gui.template)
params: table
) -> str
```

View file

@ -147,17 +147,23 @@ gui.load_document(
args: table -- параметры для события on_open
) -> string
-- Загружает шаблон в лояут
-- Обрабатывает xml шаблон макета из файла
gui.template(
-- имя шаблона в /layouts/templates без пути и расширения
name: string,
-- таблица переменных (может быть использована в разметке)
-- * Пр: <label>%{text}</label>
-- * text в данном случае, это значение из params по ключу text
params: table,
-- таблица, доступная в событиях как глобальная переменная DATA
[опционально] data: table
params: table
) -> string
-- Обрабатывает xml шаблон макета из строки
gui.process_template(
-- шаблон в виде строки
source: string,
-- таблица переменных, как в gui.template
params: table
)
```
## Корневой документ