slint/examples/cpptest/main.cpp
Simon Hausmann f2eec61968 Add a window to the top-level component
This means that we always have a window and for the C++
API we don't require this ComponentWindow use anymore.
2020-08-11 13:38:38 +02:00

19 lines
405 B
C++

#include "hello.h"
#include <iostream>
int main()
{
static Hello component;
component.on_foobar([](auto...) { std::cout << "Hello from C++" << std::endl; });
component.on_plus_clicked([]() {
component.set_counter(component.get_counter() + 1);
});
component.on_minus_clicked([]() {
component.set_counter(component.get_counter() - 1);
});
component.run();
}