working on extensions/optional parenting

This commit is contained in:
Paul Liverman 2016-04-01 15:48:58 -07:00
parent 25f77d8d16
commit ba6d7e0f7a
2 changed files with 3 additions and 3 deletions

View File

@ -23,6 +23,7 @@ function love.load()
--]] --]]
--c:move(100) --c:move(100)
pop.box({255, 0, 0, 255}):position(50, 600) -- testing streamlined_get_set extension & optional parents
--[[ --[[
w2 = pop.window(nil, "Window") w2 = pop.window(nil, "Window")

View File

@ -79,11 +79,10 @@ instanceOfElement = (object) ->
pop.create = (element, parent=pop.screen, ...) -> pop.create = (element, parent=pop.screen, ...) ->
if instanceOfElement parent if instanceOfElement parent
element = pop.elements[element](parent, ...) element = pop.elements[element](parent, ...)
insert parent.child, element
else else
element = pop.elements[element](pop.screen, parent, ...) element = pop.elements[element](pop.screen, parent, ...)
insert pop.screen.child, element
if parent
insert parent.child, element
return element return element