form.addButton¶
since 1.5.10
Add a button to the current form.
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
line |
FormLine | yes | the line where the field should be added |
rect |
Rect | yes | the coordinates |
params |
table | yes | see the fields below |
Fields of params:
text(string): button labemicon(Mask): button bitmappress(function): the function which will be called on button pressoptions(number): text flags like TEXT_LEFT, TEXT_CENTERED, etc.
Returns¶
The new button
Examples¶
From the official Ethos documentation
form.addButton(line, nil, {text="Text Button", icon="", press=function() end})
Used in¶
Real-world usage¶
Called 92 times across 8 open-source Ethos Lua projects. A few short excerpts: