ui.warn(msg , [title])
Displays a warning message dialog box with an exclamation-point icon, and waits for the user to click the OK button.
Parameters
msg
A string, or any value converted to a string, that indicates the message to display to the user.
title
An optional string that indicates the title of the message dialog box (defaulting to "Warning")
Return value
This function returns the string "ok" once the user has pressed the OK button or after having closed the dialog.Example
local ui = require "ui"
-- create a new Pipe to capture output of the "WMIC ui Win32_Battery Get EstimatedChargeRemaining" command
local pipe = sys.Pipe('cmd.exe /K "WMIC ui Win32_Battery Get EstimatedChargeRemaining"')
-- capture output
if await(pipe:readerror()) ~= nil then
error("No battery found")
end
local charge = await(pipe:read()):match("%d+")
-- Displays current battery remaining charge
ui.warn("Battery left : "..charge.."%", "Battery remainging charge")