Added frame close event cancelling

Adds a check whether the OnClose event handler returned false, in which
case it will not remove the object.
This commit is contained in:
Romet 2014-04-14 18:52:06 +03:00
parent 60ad73f8b7
commit 49d8772c15

View File

@ -71,9 +71,14 @@ function newobject:initialize()
close.parent = self
close.OnClick = function(x, y, object)
local onclose = object.parent.OnClose
object.parent:Remove()
if onclose then
onclose(object.parent)
local ret = onclose(object.parent)
if ret ~= false then
object.parent:Remove()
end
else
object.parent:Remove()
end
end