diff --git a/demo/main.lua b/demo/main.lua index e6b3992..04df5c5 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -23,6 +23,7 @@ function love.load() --]] --c:move(100) + pop.box({255, 0, 0, 255}):position(50, 600) -- testing streamlined_get_set extension & optional parents --[[ w2 = pop.window(nil, "Window") diff --git a/src/pop/init.moon b/src/pop/init.moon index b012eb8..ba3c848 100644 --- a/src/pop/init.moon +++ b/src/pop/init.moon @@ -79,11 +79,10 @@ instanceOfElement = (object) -> pop.create = (element, parent=pop.screen, ...) -> if instanceOfElement parent element = pop.elements[element](parent, ...) + insert parent.child, element else element = pop.elements[element](pop.screen, parent, ...) - - if parent - insert parent.child, element + insert pop.screen.child, element return element