1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include "../../include/gui/Page.hpp" namespace gsr { Page::~Page() { widgets.for_each([this](std::unique_ptr<Widget> &widget) { if(widget->parent_widget == this) widget->parent_widget = nullptr; return true; }, true); } void Page::add_widget(std::unique_ptr<Widget> widget) { widget->parent_widget = this; widgets.push_back(std::move(widget)); } }