This event is fired only if a notification icon has been previously loaded with Window.loadtrayicon().
Window:onTrayHover( ) event
This event is fired when the mouse hovers the notification icon of the window, in the tray section of the taskbar
Return value
The event returns no 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