diff options
Diffstat (limited to 'CruUI/ui/controls/button.h')
-rw-r--r-- | CruUI/ui/controls/button.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/CruUI/ui/controls/button.h b/CruUI/ui/controls/button.h index f9ad7726..bd3f6eb3 100644 --- a/CruUI/ui/controls/button.h +++ b/CruUI/ui/controls/button.h @@ -1,5 +1,7 @@ #pragma once +#include <initializer_list> + #include "ui/control.h" namespace cru::ui::controls @@ -7,9 +9,12 @@ namespace cru::ui::controls class Button : public Control { public: - static Button* Create() + static Button* Create(const std::initializer_list<Control*>& children = std::initializer_list<Control*>()) { - return new Button(); + const auto button = new Button(); + for (const auto control : children) + button->AddChild(control); + return button; } protected: |