deleting elements!

This commit is contained in:
Paul Liverman III 2016-04-17 00:40:48 -07:00
parent 51bb8f581a
commit a541640cfe
3 changed files with 18 additions and 0 deletions

View File

@ -235,6 +235,12 @@ do
self.y = self.parent.y + self.margin self.y = self.parent.y + self.margin
self.w = self.parent.w - self.margin * 2 self.w = self.parent.w - self.margin * 2
self.h = self.parent.h - self.margin * 2 self.h = self.parent.h - self.margin * 2
end,
delete = function(self)
for k, v in ipairs(self.child) do
v:delete()
end
return self.parent:removeChild(self)
end end
} }
_base_0.__index = _base_0 _base_0.__index = _base_0

View File

@ -235,6 +235,12 @@ do
self.y = self.parent.y + self.margin self.y = self.parent.y + self.margin
self.w = self.parent.w - self.margin * 2 self.w = self.parent.w - self.margin * 2
self.h = self.parent.h - self.margin * 2 self.h = self.parent.h - self.margin * 2
end,
delete = function(self)
for k, v in ipairs(self.child) do
v:delete()
end
return self.parent:removeChild(self)
end end
} }
_base_0.__index = _base_0 _base_0.__index = _base_0

View File

@ -253,3 +253,9 @@ class element
@y = @parent.y + @margin @y = @parent.y + @margin
@w = @parent.w - @margin*2 @w = @parent.w - @margin*2
@h = @parent.h - @margin*2 @h = @parent.h - @margin*2
delete: =>
for k,v in ipairs @child
v\delete!
@parent\removeChild @