This event is fired only if a tray icon has been previously loaded with Window.loadtrayicon().
Window.traytooltip read/write property
Get the window tray icon tooltip, a string value.
Example
local ui = require "ui"
-- create a simple Window that will stay hidden
local win = ui.Window("Window.onTrayHover() sample", 320, 200)
-- loads a notification tray icon
win:loadtrayicon(sys.env.WINDIR.."/system32/shell32.dll", 44)
local canexit = false
local tooltips = { "The stars are brilliant this evening", "The sky is clear and stars bright.", "Moon and stars are bright overhead" }
-- Display a random tooltip when mouse hovers the notification icon
function win:onTrayHover()
self.traytooltip = tooltips[math.floor(math.random(1, 3))]
end
-- Click on the notification icon to exit program
function win:onTrayClick()
canexit = true
end
-- update user interface
repeat
ui.update()
until canexit