diff --git a/tests/widgets/ExampleColorWidget.hpp b/tests/widgets/ExampleColorWidget.hpp index 07432212..a2379aad 100644 --- a/tests/widgets/ExampleColorWidget.hpp +++ b/tests/widgets/ExampleColorWidget.hpp @@ -41,32 +41,37 @@ class ExampleColorWidget : public BaseWidget, public: static constexpr const char* kExampleWidgetName = "Color"; + // SubWidget explicit ExampleColorWidget(Widget* const parent) : BaseWidget(parent), cur('r'), reverse(false), - r(0), g(99), b(32) + r(0), g(0), b(0) { - init(); + BaseWidget::setSize(300, 300); + parent->getApp().addIdleCallback(this); } + // TopLevelWidget explicit ExampleColorWidget(Window& windowToMapTo) - : BaseWidget(windowToMapTo) + : BaseWidget(windowToMapTo), + cur('r'), + reverse(false), + r(0), g(0), b(0) { - init(); + BaseWidget::setSize(300, 300); + windowToMapTo.getApp().addIdleCallback(this); } + // StandaloneWindow explicit ExampleColorWidget(Application& app) - : BaseWidget(app) - { - init(); - } - - void init() + : BaseWidget(app), + cur('r'), + reverse(false), + r(0), g(0), b(0) { BaseWidget::setSize(300, 300); - -// topWidget->getApp().addIdleCallback(this); + app.addIdleCallback(this); } protected: