Window.monitor
Retrieves the characteristics of the monitor on which the window is located, as a table containing the following fields :
"name": astringrepresenting the display name"width": the monitor physical width as anumber"height": the monitor physical height as anumber"primary": abooleanindicating if the monitor is the primary display
Example
Example
--! luart-extensions
import ui
--- create a centered Window
local win = ui.Window("Window.childs example", 320, 200)
win:center()
-- create 5 labels on this Window
for i = 1, 5 do
ui.Label(win, " Label"..i.." ", 140, (i+28)*i).bgcolor = 0x606060
end
async(function()
while true do
for widget in each(win.childs) do
widget.bgcolor = 0xFF0000
sleep(800)
widget.bgcolor = 0x606060
end
end
end)
await win:showasync()