Add clarification about on_settings callback

This commit is contained in:
Evgeny
2024-04-08 15:25:04 +04:00
parent 3917c09837
commit 3182eb0112
2 changed files with 8 additions and 19 deletions

View File

@@ -350,6 +350,14 @@ function on_action()
end end
``` ```
To change the action of the settings icon in the widget's edit menu, you can add the on_settings() function to the script. It will be called every time the user presses the icon.
```
function on_action()
ui:show_toast("Settings icon clicked!")
end
```
## Application management ## Application management
* `apps:apps([sort_by])` - returns the table of tables of all installed applications; * `apps:apps([sort_by])` - returns the table of tables of all installed applications;

View File

@@ -1,19 +0,0 @@
-- type = "search"
settings_init = false
function on_search()
if not settings_init then
search:show_buttons{ "Set settings" }
else
search:show_buttons{ "Result #1", "Result #2" }
end
end
function on_click(idx)
if not settings_init then
settings:show_dialog()
else
-- main work
end
end