system.registerSystemTool¶
since 1.1.0
Register a Lua System Tool.
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
params |
table | yes | see the fields below |
Fields of params:
name(string or function): tool nameicon(string): tool iconcreate(function, optional): handler called on widget creation, it will return the widget which is passed later to all functionswakeup(function, optional): handler called at each loopevent(function, optional): handler called when an event is received (event not passed to the parent window if the handler returns True)paint(function, optional): paint functionclose(function, optional): handler called on page closedtitle(boolean, optional): title
Returns¶
page index (integer)
Examples¶
From the official Ethos documentation
local function init()
system.registerSystemTool({name=name, icon=icon, create=create, wakeup=wakeup, event=event, paint=paint})
end
Used in¶
Real-world usage¶
Called 20 times across 8 open-source Ethos Lua projects. A few short excerpts: