add template Node::clone() and remove destroy_immediate

This commit is contained in:
2019-08-28 23:57:29 +02:00
parent ee2483be1b
commit 462c4a52e1
18 changed files with 66 additions and 60 deletions

View File

@@ -14,7 +14,7 @@ void NodeAbout::init()
SetWidthP(100);
SetHeightP(100);
SetPositioning(YGPositionTypeAbsolute);
m_template = (*m_manager)[const_hash("about")]->m_children[0]->clone();
auto m_template = (*m_manager)[const_hash("about")]->m_children[0]->clone();
add_child(m_template);
btn_ok = m_template->find<NodeButton>("btn-ok");
btn_ok->on_click = [&](Node*) { destroy(); };