Added CBaseContainer::Add() for use over AddChild()

This commit is contained in:
Rebekah 2022-04-12 12:32:12 -04:00
parent 3c7f999306
commit 06c82b2de7
Signed by: oneechanhax
GPG Key ID: 183EB7902964DAE5

View File

@ -26,6 +26,13 @@ public:
CBaseContainer(std::string name = "unnamed", IWidget* parent = nullptr);
virtual ~CBaseContainer();
template <typename T, class... Args>
T* Add(Args... args) {
auto* ret = new T(this, args...);
this->m_children.push_back(ret);
return ret;
};
void AddChild(IWidget* child);
int ChildCount();
virtual IWidget* ChildByIndex(int idx);