Browse Source

Fix ExampleColorWidget

Signed-off-by: falkTX <falktx@falktx.com>
pull/272/head
falkTX 4 years ago
parent
commit
3f3ac855ad
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 17 additions and 12 deletions
  1. +17
    -12
      tests/widgets/ExampleColorWidget.hpp

+ 17
- 12
tests/widgets/ExampleColorWidget.hpp View File

@@ -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:


Loading…
Cancel
Save