add buttons to dialog

This commit is contained in:
Evgeny
2021-07-29 18:01:05 +03:00
parent bb0bdd36a6
commit ae0cdddc9c
2 changed files with 14 additions and 4 deletions

View File

@@ -1,7 +1,15 @@
function onResume()
ui:showText("Click to open dialog")
ui:showLines({ "Click to open dialog", "Click to open dialog with custom buttons" })
end
function onClick()
ui:showDialog("Dialog title", "This is dialog")
function onClick(idx)
if idx == 1 then
ui:showDialog("Dialog title", "This is dialog")
elseif idx == 2 then
ui:showDialog("Dialog title", "This is dialog", "Button 1", "Button 2")
elseif idx == 100 then
ui:showToast("Button 1 clicked!")
elseif idx == 200 then
ui:showToast("Button 2 clicked!")
end
end