ui.monitors
Retrieves the characteristics of all the active display monitors, as an integer indexed table.
Each entry value is 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
--! luart-extensions
import ui
local win = ui.Window("ui.monitors example", 320, 200)
local tree = ui.Tree(win, {})
tree.align = "all"
tree.style = "icons"
tree.border = false
for monitor in each(ui.monitors) do
local item = tree:add(monitor.name)
item:loadicon("shell32.dll", 16)
item:add("width : "..monitor.width)
item:add("height : "..monitor.height)
item:add("primary : "..tostring(monitor.primary))
end
await win:showasync()