Skip to content

form.openWaitDialog

since 1.5.10

Open a wait dialog.

form.openWaitDialog(title, message[, progress, wakeup, close])

Parameters

Name Type Required Description
title string yes the title of the dialog
message string yes the message of the dialog
progress boolean optional (default true) adds a progress bar to the dialog
wakeup function yes handler called on each loop
close function yes handler called on close

Returns

WaitDialog

Examples

From the official Ethos documentation
local dialog = form.openWaitDialog({
  title = "Wait demo",
  message = "This is a first message",
  progress = true,
  wakeup = function() print("Wait Dialog wakeup ...") end,
  close = function() print("Wait Dialog close ...") end
})
dialog:message("This is a second message")
dialog:value(50)
dialog:closeAllowed(false)
dialog:close()

Used in

Real-world usage

Called 4 times across 3 open-source Ethos Lua projects. A few short excerpts:
if form and form.openWaitDialog then
    opts.progress = true
    return form.openWaitDialog(opts)

src/rfsuite/app/app.lua:1058

local function openProgressDialog(title, message)
    if form.openWaitDialog and ofs3.utils.ethosVersionAtLeast({26, 1, 0}) then
        return form.openWaitDialog({title = title, message = message, progress = true})
    end
    return form.openProgressDialog(title, message)
end

src/ofs3/tools/logs.lua:240

local function openProgressDialog(title, message)
    if form.openWaitDialog and dashx.utils.ethosVersionAtLeast({26, 1, 0}) then
        return form.openWaitDialog({title = title, message = message, progress = true})
    end
    return form.openProgressDialog(title, message)
end

src/dashx/tools/logs.lua:240