I have noticed some strange behavior. If you display a message box (e.g., ui.info) and then click on the button in the main window while the message box is still displayed, the onclick event of the button is executed again when the message box is closed.
local ui = require "ui"
local win = ui.Window("Button.constructor() sample", 320, 200)
local button = ui.Button(win, "LuaRT", 130, 80)
function button:onClick()
ui.info("TEST")
end
ui.run(win):wait()
It seems as if the message box is not the top window.