Window:notify(title, msg, [iconstyle]) method
Send a Windows notification.
Parameters
title
A string
representing the title of the notification
msg
A string
representing the notification message (its length should not exceed 128 characters).
[iconstyle]
A string
representing the kind of icon that should be used :
"window"
: The notification will use the current Window icon (the default)."none"
: No icon will be displayed."info"
: The notification will display an information icon."warning"
: The notification will display a warning icon."error"
: The notification will display an error icon.
Return value
The method return a boolean value, indicating wether the notification sending succeeded or not.Example
local ui = require "ui"
local win = ui.Window("Window.notify() sample", "fixed", 320, 200)
local btn = ui.Button(win, "Notify !")
btn:center()
local cb = ui.Combobox(win, false, {"window", "none", "info", "warning", "error"})
cb:center()
cb.y = btn.y + btn.height + 6
cb.selected = cb.items[1]
function btn:onClick()
win:notify(win.title, "You have successfully sent a notification !\nClick me now !", cb.text)
end
function win:onNotificationClick()
ui.info("You have clicked the notification !")
end
ui.run(win):wait()