Window:onClose() event


This event is fired when the window is about to be closed (when the user has clicked on the window close button).

Return value

This event returns true if the application actually wants to close the window or false otherwise (and the window will remain open).

Example

local ui = require "ui" -- create a window that never closes ! local win = ui.Window("Window:onClose() sample", 320, 200) -- set a onClose() event : returns false to prevent the window to close function win:onClose() return false end win:show() while win.visible do ui.update() end